comparison database/schema/bugs.sql @ 54:36d91dfe017f

use valid sql syntax, mostly from yetoo on freenode
author David A. Holland
date Sun, 10 Apr 2022 17:41:24 -0400
parents 81851564f552
children 40f64a96481f
comparison
equal deleted inserted replaced
53:62d82881799f 54:36d91dfe017f
33 -- a PR, if the new state expects a timeout the PR should be 33 -- a PR, if the new state expects a timeout the PR should be
34 -- given a non-null timeout; otherwise, the timeout field 34 -- given a non-null timeout; otherwise, the timeout field
35 -- should be nulled. 35 -- should be nulled.
36 timeout_date timestamp null, 36 timeout_date timestamp null,
37 timeout_state text null references states (name), 37 timeout_state text null references states (name),
38 check (timestamp is null == timeout_state is null), 38 check ((timeout_date is null) = (timeout_state is null)),
39 39
40 -- intended constraint: 40 -- intended constraint:
41 -- select * from PRs, states where PRs.state = states.name 41 -- select * from PRs, states where PRs.state = states.name
42 -- and states.timeout <> PRs.timeout_date is not null 42 -- and states.timeout <> PRs.timeout_date is not null
43 -- should always return empty. 43 -- should always return empty.