From 3ce992eb742cfc75195fb482de09a92b15508e77 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 17 Jan 2013 17:14:26 +0000 Subject: add internal review status to problems --- db/schema.sql | 2 ++ db/schema_0025-add_more_statuses_to_problem.sql | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'db') diff --git a/db/schema.sql b/db/schema.sql index 021c5561d..5bdd2a66a 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -193,6 +193,7 @@ create table problem ( or state = 'unable to fix' or state = 'not responsible' or state = 'duplicate' + or state = 'internal referral' ), lang text not null default 'en-gb', service text not null default '', @@ -343,6 +344,7 @@ create table comment ( or problem_state = 'unable to fix' or problem_state = 'not responsible' or problem_state = 'duplicate' + or problem_state = 'internal referral' ), -- other fields? one to indicate whether this was written by the council -- and should be highlighted in the display? diff --git a/db/schema_0025-add_more_statuses_to_problem.sql b/db/schema_0025-add_more_statuses_to_problem.sql index 9c49c8566..14d1b3195 100644 --- a/db/schema_0025-add_more_statuses_to_problem.sql +++ b/db/schema_0025-add_more_statuses_to_problem.sql @@ -18,6 +18,7 @@ BEGIN; or state = 'unable to fix' or state = 'not responsible' or state = 'duplicate' + or state = 'internal referral' ); @@ -36,40 +37,47 @@ BEGIN; or problem_state = 'unable to fix' or problem_state = 'not responsible' or problem_state = 'duplicate' + or problem_state = 'internal referral' ); UPDATE alert_type set item_where = 'nearby.problem_id = problem.id and problem.state in (''confirmed'', ''investigating'', ''planned'', ''in progress'', ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'', - ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'' )' + ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', + ''internal referral'')' WHERE ref = 'postcode_local_problems'; UPDATE alert_type set item_where = 'problem.state in (''confirmed'', ''investigating'', ''planned'', ''in progress'', ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'' - ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'' )' + ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', + ''internal referral'' )' WHERE ref = 'new_problems'; UPDATE alert_type set item_where = 'problem.state in (''fixed'', ''fixed - user'', ''fixed - council'')' WHERE ref = 'new_fixed_problems'; UPDATE alert_type set item_where = 'nearby.problem_id = problem.id and problem.state in (''confirmed'', ''investigating'', ''planned'', ''in progress'', ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'', - ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'' )' + ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', + ''internal referral'')' WHERE ref = 'local_problems'; UPDATE alert_type set item_where = 'problem.state in (''confirmed'', ''investigating'', ''planned'', ''in progress'', ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'', - ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'' ) AND + ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', + ''internal referral'' ) AND (council like ''%''||?||''%'' or council is null) and areas like ''%,''||?||'',%''' WHERE ref = 'council_problems'; UPDATE alert_type set item_where = 'problem.state in (''confirmed'', ''investigating'', ''planned'', ''in progress'', ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'', - ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'' ) AND + ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', + ''internal referral'' ) AND (council like ''%''||?||''%'' or council is null) and areas like ''%,''||?||'',%''' WHERE ref = 'ward_problems'; UPDATE alert_type set item_where = 'problem.state in (''confirmed'', ''investigating'', ''planned'', ''in progress'', ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'', - ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'' ) AND + ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', + ''internal referral'' ) AND areas like ''%,''||?||'',%''' WHERE ref = 'area_problems'; COMMIT; -- cgit v1.2.3