1 -- This script creates the module management tables |
|
2 -- |
|
3 |
|
4 create table lpit_user |
1 create table lpit_user |
5 ( |
2 ( |
6 userid serial primary key, |
3 userid serial primary key, |
7 username text not null unique, |
4 username text not null unique, |
8 mail text, |
5 mail text, |
9 lastname text, |
6 lastname text, |
10 givenname text |
7 givenname text |
11 ); |
8 ); |
12 |
9 |
|
10 create type vcstype as enum ('None', 'Mercurial', 'Git'); |
|
11 |
13 create table lpit_project |
12 create table lpit_project |
14 ( |
13 ( |
15 projectid serial primary key, |
14 projectid serial primary key, |
16 name text not null unique, |
15 name text not null unique, |
17 node text not null unique, |
16 node text not null unique, |
18 ordinal integer not null default 0, |
17 ordinal integer not null default 0, |
19 description text, |
18 description text, |
20 repoUrl text, |
19 repoUrl text, |
|
20 vcs vcstype not null default 'None'::vcstype, |
21 owner integer references lpit_user (userid) |
21 owner integer references lpit_user (userid) |
22 ); |
22 ); |
23 |
23 |
24 create type version_status as enum ( |
24 create type version_status as enum ( |
25 'Future', |
25 'Future', |
166 to_issue integer not null references lpit_issue (issueid) on delete cascade, |
166 to_issue integer not null references lpit_issue (issueid) on delete cascade, |
167 type relation_type not null |
167 type relation_type not null |
168 ); |
168 ); |
169 |
169 |
170 create unique index lpit_issue_relation_unique on lpit_issue_relation (from_issue, to_issue, type); |
170 create unique index lpit_issue_relation_unique on lpit_issue_relation (from_issue, to_issue, type); |
|
171 |
|
172 create table lpit_commit_ref |
|
173 ( |
|
174 issueid integer not null references lpit_issue (issueid) on delete cascade, |
|
175 commit_hash text not null, |
|
176 commit_brief text not null |
|
177 ); |
|
178 |
|
179 create unique index lpit_commit_ref_unique on lpit_commit_ref (issueid, commit_hash); |