aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-23 14:26:26 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-23 14:26:26 +0100
commit41c7d068f954e062b4da0675b5782211b8ad10c3 (patch)
tree509bfd3ae053af990e98d81b9ac328d66801a3c6 /db
parent59e5a595bd0a903f25eb6210209cec5afe1f699c (diff)
add problem state_column to comment
Diffstat (limited to 'db')
-rw-r--r--db/schema.sql10
-rw-r--r--db/schema_0007-add-comment-problem-state.sql16
2 files changed, 26 insertions, 0 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 984ceb690..21fc3371a 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -287,6 +287,16 @@ create table comment (
cobrand_data text not null default '' check (cobrand_data ~* '^[a-z0-9]*$'), -- Extra data used in cobranded versions of the site
mark_fixed boolean not null,
mark_open boolean not null default 'f'
+ problem_state text check (
+ problem_state = 'confirmed'
+ or problem_state = 'investigating'
+ or problem_state = 'planned'
+ or problem_state = 'in progress'
+ or problem_state = 'closed'
+ or problem_state = 'fixed'
+ or problem_state = 'fixed - council'
+ or problem_state = 'fixed - user'
+ )
-- other fields? one to indicate whether this was written by the council
-- and should be highlighted in the display?
);
diff --git a/db/schema_0007-add-comment-problem-state.sql b/db/schema_0007-add-comment-problem-state.sql
new file mode 100644
index 000000000..8fa361d83
--- /dev/null
+++ b/db/schema_0007-add-comment-problem-state.sql
@@ -0,0 +1,16 @@
+begin;
+
+ ALTER TABLE comment ADD column problem_state text;
+
+ ALTER TABLE comment ADD CONSTRAINT problem_state_check CHECK (
+ problem_state = 'confirmed'
+ or problem_state = 'investigating'
+ or problem_state = 'planned'
+ or problem_state = 'in progress'
+ or problem_state = 'closed'
+ or problem_state = 'fixed'
+ or problem_state = 'fixed - council'
+ or problem_state = 'fixed - user'
+ );
+
+commit;