aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-15 15:22:38 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-15 15:22:38 +0100
commit33074d2d554990621d6941f9c7bf02b7a8ffb18a (patch)
treeb04506fd4cee63cb37fb6ba11ca34699bf03dd2d /db
parentd6e4d4998bf0327567d745c256a76fee966faf35 (diff)
update constraint on problem states
Diffstat (limited to 'db')
-rw-r--r--db/schema.sql6
-rw-r--r--db/schema_0006-alter_problem_state.sql19
2 files changed, 25 insertions, 0 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 9c5b3d8fd..823a60485 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -165,7 +165,13 @@ create table problem (
state text not null check (
state = 'unconfirmed'
or state = 'confirmed'
+ or state = 'investigating'
+ or state = 'planned'
+ or state = 'in progress'
+ or state = 'will not fix'
or state = 'fixed'
+ or state = 'fixed - council'
+ or state = 'fixed - user'
or state = 'hidden'
or state = 'partial'
),
diff --git a/db/schema_0006-alter_problem_state.sql b/db/schema_0006-alter_problem_state.sql
new file mode 100644
index 000000000..1fdd30cb2
--- /dev/null
+++ b/db/schema_0006-alter_problem_state.sql
@@ -0,0 +1,19 @@
+begin;
+
+ ALTER TABLE problem DROP CONSTRAINT problem_state_check;
+
+ ALTER TABLE problem ADD CONSTRAINT problem_state_check CHECK (
+ state = 'unconfirmed'
+ or state = 'confirmed'
+ or state = 'investigating'
+ or state = 'planned'
+ or state = 'in progress'
+ or state = 'will not fix'
+ or state = 'fixed'
+ or state = 'fixed - council'
+ or state = 'fixed - user'
+ or state = 'hidden'
+ or state = 'partial'
+ );
+
+commit;