On Thu, 2007-03-29 at 16:41 -0500, Jeffrey C. Ollie wrote:
On Thu, 2007-03-29 at 15:55 -0400, Warren Togami wrote:
> One Time Changes
> ================
> 1) Existing cla_done is cloned to fedora_cla.
> 2) dell_cla group is created, Matt adds whoever he wants. Remove
> dell_cla members from fedora_cla.
> 3) redhat_cla group is created, populated through various means.
> 4) Modify existing Fedora CLA signing process to join fedora_cla instead
> of cla_done.
So without ever having looked at the FAS schema before today, and never
having tested this code, I think that this will clone the cla_done to
fedora_cla and create the dell_cla and redhat_cla groups...
insert into project_group
(name, owner_id, group_type)
values
('fedora_cla',
(SELECT id FROM person WHERE username = 'admin'),
'tracker');
insert into project_group
(name, owner_id, group_type)
values
('redhat_cla',
(SELECT id FROM person WHERE username = 'wtogami'),
'tracker');
insert into project_group
(name, owner_id, group_type)
values
('dell_cla',
(SELECT id FROM person WHERE username = 'admin'),
'tracker');
insert into role
(person_id, project_group_id, role_type,
role_domain, role_status, internal_comments,
sponsor_id, creation, approval)
values
(select a.person_id, b.id, a.role_type,
a.role_domain, a.role_status, a.internal_comments,
a.sponsor_id, a.creation, a.approval)
from
role a, project_group b
where
a.project_group_id is (select id from project_group where name =
'cla_done') and
b.id is (select id from project_group where name = 'fedora_cla');
Tested this on an extremely small subset of the fas db. It just needed
a few minor changes to the syntax of copying the role::
insert into project_group
(name, owner_id, group_type)
values
('fedora_cla',
(SELECT id FROM person WHERE username = 'admin'),
'tracker');
insert into project_group
(name, owner_id, group_type)
values
('redhat_cla',
(SELECT id FROM person WHERE username = 'wtogami'),
'tracker');
insert into project_group
(name, owner_id, group_type)
values
('dell_cla',
(SELECT id FROM person WHERE username = 'admin'),
'tracker');
insert into role
(person_id, project_group_id, role_type,
role_domain, role_status, internal_comments,
sponsor_id, creation, approval)
select a.person_id, b.id, a.role_type,
a.role_domain, a.role_status, a.internal_comments,
a.sponsor_id, a.creation, a.approval
from
role a, project_group b
where
a.project_group_id in (select id from project_group where name =
'cla_done') and
b.id in (select id from project_group where name = 'fedora_cla');