setup/postgres/psql_create_tables.sql

changeset 75
33b6843fdf8a
parent 62
833e0385572a
child 81
1a2e7b5d48f7
equal deleted inserted replaced
74:91d1fc2a3a14 75:33b6843fdf8a
8 lastname varchar(50), 8 lastname varchar(50),
9 givenname varchar(50) 9 givenname varchar(50)
10 ); 10 );
11 11
12 create table lpit_project ( 12 create table lpit_project (
13 id serial primary key, 13 projectid serial primary key,
14 name varchar(20) not null unique, 14 name varchar(20) not null unique,
15 description varchar(200), 15 description varchar(200),
16 repoUrl varchar(50), 16 repoUrl varchar(50),
17 owner integer references lpit_user(userid) 17 owner integer references lpit_user(userid)
18 ); 18 );
24 'LTS', 24 'LTS',
25 'Deprecated' 25 'Deprecated'
26 ); 26 );
27 27
28 create table lpit_version ( 28 create table lpit_version (
29 id serial primary key, 29 versionid serial primary key,
30 project integer not null references lpit_project(id), 30 project integer not null references lpit_project(projectid),
31 name varchar(20) not null, 31 name varchar(20) not null,
32 ordinal integer not null default 0, 32 ordinal integer not null default 0,
33 status version_status not null default 'Future' 33 status version_status not null default 'Future'
34 ); 34 );
35 35
51 'Task', 51 'Task',
52 'Test' 52 'Test'
53 ); 53 );
54 54
55 create table lpit_issue ( 55 create table lpit_issue (
56 id serial primary key, 56 issueid serial primary key,
57 project integer not null references lpit_project(id), 57 project integer not null references lpit_project(projectid),
58 status issue_status not null default 'InSpecification', 58 status issue_status not null default 'InSpecification',
59 category issue_category not null default 'Feature', 59 category issue_category not null default 'Feature',
60 subject varchar(20) not null, 60 subject varchar(20) not null,
61 description text, 61 description text,
62 version_plan integer references lpit_version(id), 62 assignee integer references lpit_user(userid),
63 version_done integer references lpit_version(id),
64 created timestamp with time zone not null default now(), 63 created timestamp with time zone not null default now(),
65 updated timestamp with time zone not null default now(), 64 updated timestamp with time zone not null default now(),
66 eta date 65 eta date
67 ); 66 );
67
68 create table lpit_issue_affected_version (
69 issueid integer references lpit_issue(issueid),
70 versionid integer references lpit_version(versionid),
71 primary key (issueid, versionid)
72 );
73
74 create table lpit_issue_scheduled_version (
75 issueid integer references lpit_issue(issueid),
76 versionid integer references lpit_version(versionid),
77 primary key (issueid, versionid)
78 );
79
80 create table lpit_issue_resolved_version (
81 issueid integer references lpit_issue(issueid),
82 versionid integer references lpit_version(versionid),
83 primary key (issueid, versionid)
84 );
85
86

mercurial