Mercurial > ~dholland > hg > swallowtail > index.cgi
annotate database/schema/bugs.sql @ 10:1720f45dd495
Replace insane handling of states with something more likely workable.
author | David A. Holland |
---|---|
date | Sun, 19 Feb 2012 20:21:51 -0500 |
parents | 68cc276ac118 |
children | d4c3bd255653 |
rev | line source |
---|---|
8
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
1 -- |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
2 -- PR data. |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
3 -- |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
4 -- PRs is the primary table of bug info, with one row per problem |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
5 -- report. |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
6 -- |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
7 |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
8 CREATE SEQUENCE next_PR; |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
9 |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
10 CREATE TABLE PRs ( |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
11 id bigint primary key default nextval('next_PR'), |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
12 |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
13 -- basic description |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
14 synopsis text not null, |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
15 confidential boolean not null, |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
16 |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
17 -- states |
10
1720f45dd495
Replace insane handling of states with something more likely workable.
David A. Holland
parents:
8
diff
changeset
|
18 state text not null references states (name); |
1720f45dd495
Replace insane handling of states with something more likely workable.
David A. Holland
parents:
8
diff
changeset
|
19 locked boolean not null, -- deny modifications |
8
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
20 |
10
1720f45dd495
Replace insane handling of states with something more likely workable.
David A. Holland
parents:
8
diff
changeset
|
21 -- intended constraint: |
1720f45dd495
Replace insane handling of states with something more likely workable.
David A. Holland
parents:
8
diff
changeset
|
22 -- select * from PRs, states where PRs.state = states.name |
1720f45dd495
Replace insane handling of states with something more likely workable.
David A. Holland
parents:
8
diff
changeset
|
23 -- and states.closed = false and PRs.locked = true |
1720f45dd495
Replace insane handling of states with something more likely workable.
David A. Holland
parents:
8
diff
changeset
|
24 -- should always return empty. |
1720f45dd495
Replace insane handling of states with something more likely workable.
David A. Holland
parents:
8
diff
changeset
|
25 -- (no PR should be locked unless it is closed) |
8
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
26 |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
27 -- fixed-size history |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
28 arrival_schemaversion int not null, |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
29 arrival_date date not null, |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
30 closed_date date , |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
31 |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
32 -- original submitter |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
33 originator bigint references users (id), |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
34 |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
35 -- original submission |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
36 -- we don't keep this as such - these items go into an |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
37 -- entry in the admin log instead, and the submitter is |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
38 -- automatically subscribed to the bug. |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
39 -- "Submitted by joe@schmoe, Message-Id <3@schmoe>, Subject: foo" |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
40 --from_address text not null, |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
41 --mail_subject text not null, |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
42 --mail_msgid text not null, |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
43 |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
44 -- contents |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
45 release text , |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
46 environment text , |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
47 description text , |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
48 how_to_repeat text , |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
49 fix text , |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
50 unformatted text |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
51 |
68cc276ac118
SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff
changeset
|
52 ) without oids; |