
-- Keep specific projects

create table gna_export_groups
as select * from groups
where unix_group_name in ('getfem');

--
-- Trackers: bugs
--

create table gna_export_bugs
as select * from bugs
where group_id in (select group_id from gna_export_groups);

create table gna_export_bugs_cc
as select * from bugs_cc
where bug_id in (select distinct bug_id from gna_export_bugs);

create table gna_export_bugs_history
as select * from bugs_history
where bug_id in (select distinct bug_id from gna_export_bugs);

create table gna_export_bugs_canned_responses
as select * from bugs_canned_responses
where group_id in (select group_id from gna_export_groups);

create table gna_export_bugs_field_usage
as select * from bugs_field_usage
where group_id in (select group_id from gna_export_groups);

create table gna_export_bugs_field_value
as select * from bugs_field_value
where group_id in (select group_id from gna_export_groups);

create table gna_export_bugs_field_report
as select * from bugs_field_rpeort
where group_id in (select group_id from gna_export_groups);

create table gna_export_trackers_file
as select * from trackers_files
where
(artifact='bugs' and item_id in (select distinct bug_id from gnua_export_bugs);
