aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-12-03 11:21:45 +0000
committerStruan Donald <struan@exo.org.uk>2012-12-03 17:49:11 +0000
commit59b4cd804cf9134f830109bfc51fba3856a21ea3 (patch)
tree1ba85066b4a9edea4cbb48b632d11ac6e69bb5b8
parent6ba4943e11f6c9a05c907a948d1f3a67f518031d (diff)
add subcategory field to problem table
-rw-r--r--db/schema.sql5
-rw-r--r--db/schema_0027-add_sub_category_to_problem.sql6
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm6
3 files changed, 14 insertions, 3 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 6ebec5689..87e785de2 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -217,7 +217,10 @@ create table problem (
external_source_id text,
-- number of me toos
- interest_count integer default 0
+ interest_count integer default 0,
+
+ -- subcategory to enable filtering in reporting --
+ subcategory text
);
create index problem_state_latitude_longitude_idx on problem(state, latitude, longitude);
create index problem_user_id_idx on problem ( user_id );
diff --git a/db/schema_0027-add_sub_category_to_problem.sql b/db/schema_0027-add_sub_category_to_problem.sql
new file mode 100644
index 000000000..6787bd371
--- /dev/null
+++ b/db/schema_0027-add_sub_category_to_problem.sql
@@ -0,0 +1,6 @@
+begin;
+
+ALTER TABLE problem
+ ADD COLUMN subcategory TEXT;
+
+commit;
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index ce197076b..02e5adb7d 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -100,6 +100,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 },
"interest_count",
{ data_type => "integer", is_nullable => 1 },
+ "subcategory",
+ { data_type => "text", is_nullable => 1 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->has_many(
@@ -122,8 +124,8 @@ __PACKAGE__->belongs_to(
);
-# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-08-31 10:25:34
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mudIAiLAUdmK8gGWIPiq6g
+# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-03 17:48:10
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xN/RB8Vx50CwyOeBjvJezQ
# Add fake relationship to stored procedure table
__PACKAGE__->has_one(