
diff -r dcb1d5a7ea3a -r 296e12ff8d1c setup/postgres/psql_create_tables.sql
--- a/setup/postgres/psql_create_tables.sql	Thu Aug 19 14:51:04 2021 +0200
+++ b/setup/postgres/psql_create_tables.sql	Thu Aug 19 17:20:43 2021 +0200
@@ -101,6 +101,35 @@
     resolved    integer references lpit_version (versionid)
 );
 
+create type issue_history_event as enum (
+    'New',
+    'Update',
+    'NewComment',
+    'UpdateComment'
+    );
+
+create table lpit_issue_history_event
+(
+    eventid serial primary key,
+    issueid integer                  not null references lpit_issue (issueid) on delete cascade,
+    time    timestamp with time zone not null default now(),
+    type    issue_history_event      not null
+);
+
+create table lpit_issue_history_data
+(
+    eventid     integer        not null references lpit_issue_history_event (eventid) on delete cascade,
+    component   text,
+    status      issue_status   not null,
+    category    issue_category not null,
+    subject     text           not null,
+    description text,
+    assignee    text,
+    eta         date,
+    affected    text,
+    resolved    text
+);
+
 create table lpit_issue_comment
 (
     commentid   serial primary key,
@@ -111,3 +140,11 @@
     updatecount integer                  not null default 0,
     comment     text                     not null
 );
+
+create table lpit_issue_comment_history
+(
+    commentid integer not null references lpit_issue_comment (commentid) on delete cascade,
+    eventid   integer not null references lpit_issue_history_event (eventid) on delete cascade,
+    comment   text    not null
+);
+




