Mercurial > ~dholland > hg > swallowtail > index.cgi
comparison database/schema/subscription.sql @ 29:cd36b49f4437
fix.
now loads into postgresql92
author | David A. Holland |
---|---|
date | Sun, 26 May 2013 23:24:45 -0400 |
parents | 68cc276ac118 |
children | 40f64a96481f |
comparison
equal
deleted
inserted
replaced
28:000519947282 | 29:cd36b49f4437 |
---|---|
12 -- | 12 -- |
13 -- The original submitter is automatically subscribed as a reporter. | 13 -- The original submitter is automatically subscribed as a reporter. |
14 | 14 |
15 CREATE TABLE subscriptions ( | 15 CREATE TABLE subscriptions ( |
16 pr bigint not null references PRs (id), | 16 pr bigint not null references PRs (id), |
17 user bigint not null references users (id), | 17 userid bigint not null references users (id), |
18 batch boolean not null, | 18 batch boolean not null, |
19 reporter boolean not null, | 19 reporter boolean not null, |
20 responsible boolean not null | 20 responsible boolean not null |
21 ) | 21 ) |
22 WITHOUT OIDS; | 22 WITHOUT OIDS; |
23 | 23 |
24 -- Intended constraints: | 24 -- Intended constraints: |
25 -- | 25 -- |
26 -- SELECT id, responsible FROM PRs, subscriptions, users | 26 -- SELECT id, responsible FROM PRs, subscriptions, users |
27 -- WHERE PRs.id = subscriptions.id | 27 -- WHERE PRs.id = subscriptions.id |
28 -- AND subscriptions.user = users.id | 28 -- AND subscriptions.userid = users.id |
29 -- AND PRs.state <> 'closed' | 29 -- AND PRs.state <> 'closed' |
30 -- AND subscriptions.responsible | 30 -- AND subscriptions.responsible |
31 -- AND NOT users.responsible | 31 -- AND NOT users.responsible |
32 -- ; | 32 -- ; |
33 -- | 33 -- |
34 -- and | 34 -- and |
35 -- | 35 -- |
36 -- SELECT id, responsible FROM PRs, subscriptions, users | 36 -- SELECT id, responsible FROM PRs, subscriptions, users |
37 -- WHERE PRs.id = subscriptions.id | 37 -- WHERE PRs.id = subscriptions.id |
38 -- AND subscriptions.user = users.id | 38 -- AND subscriptions.userid = users.id |
39 -- AND PRs.state = 'closed' | 39 -- AND PRs.state = 'closed' |
40 -- AND subscriptions.responsible | 40 -- AND subscriptions.responsible |
41 -- AND NOT users.oldresponsible | 41 -- AND NOT users.oldresponsible |
42 -- ; | 42 -- ; |
43 -- | 43 -- |