--- a/setup/postgres/psql_create_tables.sql Fri Dec 30 13:21:09 2022 +0100 +++ b/setup/postgres/psql_create_tables.sql Fri Dec 30 19:04:34 2022 +0100 @@ -149,3 +149,21 @@ comment text not null ); +create type relation_type as enum ( + 'RelatesTo', + 'TogetherWith', + 'Before', + 'SubtaskOf', + 'Blocks', + 'Tests', + 'Duplicates' + ); + +create table lpit_issue_relation +( + from_issue integer not null references lpit_issue (issueid) on delete cascade, + to_issue integer not null references lpit_issue (issueid) on delete cascade, + type relation_type not null +); + +create unique index lpit_issue_relation_unique on lpit_issue_relation (from_issue, to_issue, type);