aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/fixture.sql (renamed from db/alert_types.sql)10
-rw-r--r--db/schema.sql2
-rw-r--r--db/schema_0054-add-state-table.sql12
3 files changed, 22 insertions, 2 deletions
diff --git a/db/alert_types.sql b/db/fixture.sql
index 84f446f2c..840906223 100644
--- a/db/alert_types.sql
+++ b/db/fixture.sql
@@ -1,3 +1,13 @@
+INSERT INTO state (label, type, name) VALUES ('investigating', 'open', 'Investigating');
+INSERT INTO state (label, type, name) VALUES ('in progress', 'open', 'In progress');
+INSERT INTO state (label, type, name) VALUES ('planned', 'open', 'Planned');
+INSERT INTO state (label, type, name) VALUES ('action scheduled', 'open', 'Action scheduled');
+INSERT INTO state (label, type, name) VALUES ('unable to fix', 'closed', 'No further action');
+INSERT INTO state (label, type, name) VALUES ('not responsible', 'closed', 'Not responsible');
+INSERT INTO state (label, type, name) VALUES ('duplicate', 'closed', 'Duplicate');
+INSERT INTO state (label, type, name) VALUES ('internal referral', 'closed', 'Internal referral');
+INSERT INTO state (label, type, name) VALUES ('fixed', 'fixed', 'Fixed');
+
-- New updates on a particular problem report
insert into alert_type
(ref, head_sql_query, head_table,
diff --git a/db/schema.sql b/db/schema.sql
index 12e66b53a..fedab2b9d 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -519,6 +519,6 @@ CREATE TABLE report_extra_fields (
CREATE TABLE state (
id serial not null primary key,
label text not null unique,
- type text not null check (type = 'open' OR type = 'closed'),
+ type text not null check (type = 'open' OR type = 'closed' OR type = 'fixed'),
name text not null unique
);
diff --git a/db/schema_0054-add-state-table.sql b/db/schema_0054-add-state-table.sql
index c052f145a..c4be36015 100644
--- a/db/schema_0054-add-state-table.sql
+++ b/db/schema_0054-add-state-table.sql
@@ -3,10 +3,20 @@ BEGIN;
CREATE TABLE state (
id serial not null primary key,
label text not null unique,
- type text not null check (type = 'open' OR type = 'closed'),
+ type text not null check (type = 'open' OR type = 'closed' OR type = 'fixed'),
name text not null unique
);
+INSERT INTO state (label, type, name) VALUES ('investigating', 'open', 'Investigating');
+INSERT INTO state (label, type, name) VALUES ('in progress', 'open', 'In progress');
+INSERT INTO state (label, type, name) VALUES ('planned', 'open', 'Planned');
+INSERT INTO state (label, type, name) VALUES ('action scheduled', 'open', 'Action scheduled');
+INSERT INTO state (label, type, name) VALUES ('unable to fix', 'closed', 'No further action');
+INSERT INTO state (label, type, name) VALUES ('not responsible', 'closed', 'Not responsible');
+INSERT INTO state (label, type, name) VALUES ('duplicate', 'closed', 'Duplicate');
+INSERT INTO state (label, type, name) VALUES ('internal referral', 'closed', 'Internal referral');
+INSERT INTO state (label, type, name) VALUES ('fixed', 'fixed', 'Fixed');
+
ALTER TABLE problem DROP CONSTRAINT problem_state_check;
ALTER TABLE comment DROP CONSTRAINT comment_problem_state_check;