
diff -r 91d1fc2a3a14 -r 33b6843fdf8a setup/postgres/psql_create_tables.sql
--- a/setup/postgres/psql_create_tables.sql	Fri May 22 17:26:27 2020 +0200
+++ b/setup/postgres/psql_create_tables.sql	Fri May 22 21:23:57 2020 +0200
@@ -10,7 +10,7 @@
 );
 
 create table lpit_project (
-    id              serial          primary key,
+    projectid       serial          primary key,
     name            varchar(20)     not null unique,
     description     varchar(200),
     repoUrl         varchar(50),
@@ -26,8 +26,8 @@
 );
 
 create table lpit_version (
-    id              serial          primary key,
-    project         integer         not null references lpit_project(id),
+    versionid       serial          primary key,
+    project         integer         not null references lpit_project(projectid),
     name            varchar(20)     not null,
     ordinal         integer         not null default 0,
     status          version_status  not null default 'Future'
@@ -53,15 +53,34 @@
 );
 
 create table lpit_issue (
-    id              serial          primary key,
-    project         integer         not null references lpit_project(id),
+    issueid         serial          primary key,
+    project         integer         not null references lpit_project(projectid),
     status          issue_status    not null default 'InSpecification',
     category        issue_category  not null default 'Feature',
     subject         varchar(20)     not null,
     description     text,
-    version_plan    integer         references lpit_version(id),
-    version_done    integer         references lpit_version(id),
+    assignee        integer         references lpit_user(userid),
     created         timestamp       with time zone not null default now(),
     updated         timestamp       with time zone not null default now(),
     eta             date
 );
+
+create table lpit_issue_affected_version (
+    issueid         integer         references lpit_issue(issueid),
+    versionid       integer         references lpit_version(versionid),
+    primary key (issueid, versionid)
+);
+
+create table lpit_issue_scheduled_version (
+    issueid         integer         references lpit_issue(issueid),
+    versionid       integer         references lpit_version(versionid),
+    primary key (issueid, versionid)
+);
+
+create table lpit_issue_resolved_version (
+    issueid         integer         references lpit_issue(issueid),
+    versionid       integer         references lpit_version(versionid),
+    primary key (issueid, versionid)
+);
+
+




