Mercurial > ~dholland > hg > swallowtail > index.cgi
comparison 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 |
comparison
equal
deleted
inserted
replaced
9:efb427d8b704 | 10:1720f45dd495 |
---|---|
13 -- basic description | 13 -- basic description |
14 synopsis text not null, | 14 synopsis text not null, |
15 confidential boolean not null, | 15 confidential boolean not null, |
16 | 16 |
17 -- states | 17 -- states |
18 -- | 18 state text not null references states (name); |
19 -- there are 64 combinations but only these 15 are valid: | 19 locked boolean not null, -- deny modifications |
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 | 20 |
44 locked boolean not null, -- deny modifications | 21 -- intended constraint: |
45 open boolean not null, -- master switch | 22 -- select * from PRs, states where PRs.state = states.name |
46 | 23 -- and states.closed = false and PRs.locked = true |
47 invalid boolean not null, -- report is no good | 24 -- should always return empty. |
48 analyzed boolean not null, -- issue is believed understood | 25 -- (no PR should be locked unless it is closed) |
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 | 26 |
61 -- fixed-size history | 27 -- fixed-size history |
62 arrival_schemaversion int not null, | 28 arrival_schemaversion int not null, |
63 arrival_date date not null, | 29 arrival_date date not null, |
64 closed_date date , | 30 closed_date date , |