--- a/setup/postgres/psql_create_tables.sql Thu Oct 22 12:00:34 2020 +0200 +++ b/setup/postgres/psql_create_tables.sql Thu Oct 22 13:03:26 2020 +0200 @@ -12,6 +12,7 @@ create table lpit_project ( projectid serial primary key, name varchar(20) not null unique, + node varchar(20) not null unique, description varchar(200), repoUrl varchar(50), owner integer references lpit_user(userid) @@ -29,21 +30,26 @@ versionid serial primary key, project integer not null references lpit_project(projectid), name varchar(20) not null, + node varchar(20) not null, ordinal integer not null default 0, status version_status not null default 'Future' ); +create unique index lpit_version_node_unique on lpit_version(project, node); create table lpit_component ( id serial primary key, project integer not null references lpit_project(projectid), name varchar(20) not null, + node varchar(20) not null, color char(6) not null default '000000', ordinal integer not null default 0, description text, lead integer references lpit_user(userid) ); +create unique index lpit_component_node_unique on lpit_component(project, node); + create type issue_status as enum ( 'InSpecification', 'ToDo',