diff options
author | Struan Donald <struan@exo.org.uk> | 2012-08-31 10:34:24 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-08-31 13:00:51 +0100 |
commit | 12e567387969c3d13d0519de353d65df8072417c (patch) | |
tree | 5578be3e799bf04e0d1f315cab57812457f353bb | |
parent | 7a5fed80a9b945b6cee6b034f26518d19751e61a (diff) |
add non-public fields to contacts and problem
-rw-r--r-- | db/schema.sql | 10 | ||||
-rw-r--r-- | db/schema_0024-add_non_public_categories_and_problems.sql | 9 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Contact.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 8 |
4 files changed, 26 insertions, 7 deletions
diff --git a/db/schema.sql b/db/schema.sql index 832104991..6e9396f45 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -81,7 +81,10 @@ create table contacts ( note text not null, -- extra fields required for open311 - extra text + extra text, + + -- for things like missed bin collections + non_public boolean default 'f' ); create unique index contacts_area_id_category_idx on contacts(area_id, category); @@ -198,7 +201,10 @@ create table problem ( send_fail_timestamp timestamp, -- record send_method used, which can be used to infer usefulness of external_id - send_method_used text + send_method_used text, + + -- for things like missed bin collections + non_public BOOLEAN default 'f' ); 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_0024-add_non_public_categories_and_problems.sql b/db/schema_0024-add_non_public_categories_and_problems.sql new file mode 100644 index 000000000..007368ac0 --- /dev/null +++ b/db/schema_0024-add_non_public_categories_and_problems.sql @@ -0,0 +1,9 @@ +BEGIN; + + ALTER TABLE contacts + ADD COLUMN non_public BOOLEAN DEFAULT 'f'; + + ALTER TABLE problem + ADD COLUMN non_public BOOLEAN DEFAULT 'f'; + +COMMIT; diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index c32b75d0c..cad12f1fc 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -36,13 +36,15 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0 }, "extra", { data_type => "text", is_nullable => 1 }, + "non_public", + { data_type => "boolean", default_value => \"false", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->add_unique_constraint("contacts_area_id_category_idx", ["area_id", "category"]); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hyvU0bMWSFxEPAJT7wqM/Q +# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-08-31 10:29:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t6yOPhZmedV/eH6AUvHI6w __PACKAGE__->filter_column( extra => { diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 9ae040acc..a1cf107a9 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -85,13 +85,15 @@ __PACKAGE__->add_columns( "geocode", { data_type => "bytea", is_nullable => 1 }, "send_fail_count", - { data_type => "integer", is_nullable => 1 }, + { data_type => "integer", default_value => 0, is_nullable => 0 }, "send_fail_reason", { data_type => "text", is_nullable => 1 }, "send_fail_timestamp", { data_type => "timestamp", is_nullable => 1 }, "send_method_used", { data_type => "text", is_nullable => 1 }, + "non_public", + { data_type => "boolean", default_value => \"false", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->has_many( @@ -114,8 +116,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-05-03 16:05:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EvwI91Ot7SioQWqwnXRTBQ +# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-08-31 10:25:34 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mudIAiLAUdmK8gGWIPiq6g # Add fake relationship to stored procedure table __PACKAGE__->has_one( |