setup/postgres/psql_create_tables.sql

changeset 232
296e12ff8d1c
parent 231
dcb1d5a7ea3a
child 239
9365c7fb0240
equal deleted inserted replaced
231:dcb1d5a7ea3a 232:296e12ff8d1c
99 eta date, 99 eta date,
100 affected integer references lpit_version (versionid), 100 affected integer references lpit_version (versionid),
101 resolved integer references lpit_version (versionid) 101 resolved integer references lpit_version (versionid)
102 ); 102 );
103 103
104 create type issue_history_event as enum (
105 'New',
106 'Update',
107 'NewComment',
108 'UpdateComment'
109 );
110
111 create table lpit_issue_history_event
112 (
113 eventid serial primary key,
114 issueid integer not null references lpit_issue (issueid) on delete cascade,
115 time timestamp with time zone not null default now(),
116 type issue_history_event not null
117 );
118
119 create table lpit_issue_history_data
120 (
121 eventid integer not null references lpit_issue_history_event (eventid) on delete cascade,
122 component text,
123 status issue_status not null,
124 category issue_category not null,
125 subject text not null,
126 description text,
127 assignee text,
128 eta date,
129 affected text,
130 resolved text
131 );
132
104 create table lpit_issue_comment 133 create table lpit_issue_comment
105 ( 134 (
106 commentid serial primary key, 135 commentid serial primary key,
107 issueid integer not null references lpit_issue (issueid), 136 issueid integer not null references lpit_issue (issueid),
108 userid integer references lpit_user (userid), 137 userid integer references lpit_user (userid),
109 created timestamp with time zone not null default now(), 138 created timestamp with time zone not null default now(),
110 updated timestamp with time zone not null default now(), 139 updated timestamp with time zone not null default now(),
111 updatecount integer not null default 0, 140 updatecount integer not null default 0,
112 comment text not null 141 comment text not null
113 ); 142 );
143
144 create table lpit_issue_comment_history
145 (
146 commentid integer not null references lpit_issue_comment (commentid) on delete cascade,
147 eventid integer not null references lpit_issue_history_event (eventid) on delete cascade,
148 comment text not null
149 );
150

mercurial