Mercurial > ~dholland > hg > swallowtail > index.cgi
diff 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 |
line wrap: on
line diff
--- a/database/schema/bugs.sql Sun Feb 19 19:55:32 2012 -0500 +++ b/database/schema/bugs.sql Sun Feb 19 20:21:51 2012 -0500 @@ -15,48 +15,14 @@ confidential boolean not null, -- states - -- - -- there are 64 combinations but only these 15 are valid: - -- (un)locked closed ("closed") - -- (un)locked closed analyzed ("closed") - -- (un)locked closed invalid ("dead") - -- unlocked open ("open") - -- unlocked open analyzed ("analyzed") - -- unlocked open analyzed? feedback ("feedback") - -- unlocked open analyzed? suspended ("suspended") - -- unlocked open analyzed? feedback suspended ("stuck") - -- unlocked open invalid feedback ("incomplete") - -- - -- gnats states map to: open inval. anal. feedb. susp. - -- open open - -- analyzed open analyzed - -- feedback open feedback - -- (pullups-needed) open (*) - -- pending-pullups open (*) - -- suspended open analyzed suspended - -- (stuck) open feedback suspended - -- closed - - -- dead invalid - -- - -- The cases marked (*) are distinguished from open by the - -- branchstate in the relevance table. + state text not null references states (name); + locked boolean not null, -- deny modifications - locked boolean not null, -- deny modifications - open boolean not null, -- master switch - - invalid boolean not null, -- report is no good - analyzed boolean not null, -- issue is believed understood - feedback boolean not null, -- feedback required - suspended boolean not null, -- work halted - - -- feedback and suspended imply open - check NOT (NOT open AND (feedback OR suspended)), - -- invalid precludes analyzed and suspended - check NOT (invalid AND (analyzed OR suspended)), - -- open and invalid implies feedback - check NOT (NOT feedback AND open AND invalid), - -- locked implies not open - check NOT (open AND locked), + -- intended constraint: + -- select * from PRs, states where PRs.state = states.name + -- and states.closed = false and PRs.locked = true + -- should always return empty. + -- (no PR should be locked unless it is closed) -- fixed-size history arrival_schemaversion int not null,