comparison database/schema/bugs.sql @ 8:68cc276ac118

SQL material from old tree, split up for accessibility.
author David A. Holland
date Sun, 19 Feb 2012 19:54:48 -0500
parents
children 1720f45dd495
comparison
equal deleted inserted replaced
7:c013fb703183 8:68cc276ac118
1 --
2 -- PR data.
3 --
4 -- PRs is the primary table of bug info, with one row per problem
5 -- report.
6 --
7
8 CREATE SEQUENCE next_PR;
9
10 CREATE TABLE PRs (
11 id bigint primary key default nextval('next_PR'),
12
13 -- basic description
14 synopsis text not null,
15 confidential boolean not null,
16
17 -- states
18 --
19 -- there are 64 combinations but only these 15 are valid:
20 -- (un)locked closed ("closed")
21 -- (un)locked closed analyzed ("closed")
22 -- (un)locked closed invalid ("dead")
23 -- unlocked open ("open")
24 -- unlocked open analyzed ("analyzed")
25 -- unlocked open analyzed? feedback ("feedback")
26 -- unlocked open analyzed? suspended ("suspended")
27 -- unlocked open analyzed? feedback suspended ("stuck")
28 -- unlocked open invalid feedback ("incomplete")
29 --
30 -- gnats states map to: open inval. anal. feedb. susp.
31 -- open open
32 -- analyzed open analyzed
33 -- feedback open feedback
34 -- (pullups-needed) open (*)
35 -- pending-pullups open (*)
36 -- suspended open analyzed suspended
37 -- (stuck) open feedback suspended
38 -- closed -
39 -- dead invalid
40 --
41 -- The cases marked (*) are distinguished from open by the
42 -- branchstate in the relevance table.
43
44 locked boolean not null, -- deny modifications
45 open boolean not null, -- master switch
46
47 invalid boolean not null, -- report is no good
48 analyzed boolean not null, -- issue is believed understood
49 feedback boolean not null, -- feedback required
50 suspended boolean not null, -- work halted
51
52 -- feedback and suspended imply open
53 check NOT (NOT open AND (feedback OR suspended)),
54 -- invalid precludes analyzed and suspended
55 check NOT (invalid AND (analyzed OR suspended)),
56 -- open and invalid implies feedback
57 check NOT (NOT feedback AND open AND invalid),
58 -- locked implies not open
59 check NOT (open AND locked),
60
61 -- fixed-size history
62 arrival_schemaversion int not null,
63 arrival_date date not null,
64 closed_date date ,
65
66 -- original submitter
67 originator bigint references users (id),
68
69 -- original submission
70 -- we don't keep this as such - these items go into an
71 -- entry in the admin log instead, and the submitter is
72 -- automatically subscribed to the bug.
73 -- "Submitted by joe@schmoe, Message-Id <3@schmoe>, Subject: foo"
74 --from_address text not null,
75 --mail_subject text not null,
76 --mail_msgid text not null,
77
78 -- contents
79 release text ,
80 environment text ,
81 description text ,
82 how_to_repeat text ,
83 fix text ,
84 unformatted text
85
86 ) without oids;