annotate database/schema/bugs.sql @ 38:68a4f2d8930e

Add stuff for automatic feedback timeout.
author David A. Holland
date Sun, 15 Jun 2014 17:21:54 -0400
parents 7458a278cb64
children 45bb7b516edb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
29
David A. Holland
parents: 12
diff changeset
18 state text not null references states (name),
10
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
38
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
27 -- Timeouts cause bugs to automatically change state in the
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
28 -- future. This is intended to be used for e.g. "feedback
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
29 -- timeout".
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
30 --
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
31 -- States that should have a timeout installed are tagged
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
32 -- accordingly in the states table. When changing the state of
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
33 -- a PR, if the new state expects a timeout the PR should be
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
34 -- given a non-null timeout; otherwise, the timeout field
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
35 -- should be nulled.
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
36 timeout_date timestamp null,
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
37 timeout_state text null references states (name),
68a4f2d8930e Add stuff for automatic feedback timeout.
David A. Holland
parents: 32
diff changeset
38
8
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
39 -- fixed-size history
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
40 arrival_schemaversion int not null,
12
d4c3bd255653 "timestamp", not "date". from asau
David A. Holland
parents: 10
diff changeset
41 arrival_date timestamp not null,
32
7458a278cb64 forgot modified_date
David A. Holland
parents: 29
diff changeset
42 modified_date timestamp not null,
12
d4c3bd255653 "timestamp", not "date". from asau
David A. Holland
parents: 10
diff changeset
43 closed_date timestamp ,
8
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
44
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
45 -- original submitter
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
46 originator bigint references users (id),
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
47
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
48 -- original submission
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
49 -- 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
50 -- 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
51 -- automatically subscribed to the bug.
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
52 -- "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
53 --from_address text not null,
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
54 --mail_subject text not null,
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
55 --mail_msgid text not null,
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
56
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
57 -- contents
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
58 release text ,
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
59 environment text ,
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
60 description text ,
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
61 how_to_repeat text ,
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
62 fix text ,
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
63 unformatted text
68cc276ac118 SQL material from old tree, split up for accessibility.
David A. Holland
parents:
diff changeset
64
29
David A. Holland
parents: 12
diff changeset
65 )
David A. Holland
parents: 12
diff changeset
66 WITHOUT OIDS;