aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-10 16:51:09 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-08-09 18:32:04 +0100
commite46f7af02ad2b54033bc9c525e7473ca256d9188 (patch)
tree42b5cee8ffae216504f87e8842fb0abb86e4c835
parent68461d28992628ff394e05d56ab3ab962d048db0 (diff)
add flagged flags to problems and users
-rw-r--r--db/schema.sql6
-rw-r--r--db/schema_0005-add_abuse_flags_to_users_and_reports.sql9
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm2
-rw-r--r--perllib/FixMyStreet/DB/Result/User.pm2
4 files changed, 17 insertions, 2 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 9c5b3d8fd..d0a9c3c9a 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -130,7 +130,8 @@ create table users (
email text not null unique,
name text,
phone text,
- password text not null default ''
+ password text not null default '',
+ flagged boolean not null default 'f'
);
-- Problems reported by users of site
@@ -175,7 +176,8 @@ create table problem (
cobrand_data text not null default '' check (cobrand_data ~* '^[a-z0-9]*$'), -- Extra data used in cobranded versions of the site
lastupdate timestamp not null default ms_current_timestamp(),
whensent timestamp,
- send_questionnaire boolean not null default 't'
+ send_questionnaire boolean not null default 't',
+ flagged boolean not null 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_0005-add_abuse_flags_to_users_and_reports.sql b/db/schema_0005-add_abuse_flags_to_users_and_reports.sql
new file mode 100644
index 000000000..040d3294d
--- /dev/null
+++ b/db/schema_0005-add_abuse_flags_to_users_and_reports.sql
@@ -0,0 +1,9 @@
+begin;
+
+ALTER table problem
+ ADD column flagged BOOL NOT NULL DEFAULT 'f';
+
+ALTER table users
+ ADD column flagged BOOL NOT NULL DEFAULT 'f';
+
+commit;
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 2df26fde3..6472b91db 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -78,6 +78,8 @@ __PACKAGE__->add_columns(
{ data_type => "timestamp", is_nullable => 1 },
"send_questionnaire",
{ data_type => "boolean", default_value => \"true", is_nullable => 0 },
+ "flagged",
+ { data_type => "boolean", default_value => \"false", is_nullable => 0 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->has_many(
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm
index 4ee413a58..cf4fc56d5 100644
--- a/perllib/FixMyStreet/DB/Result/User.pm
+++ b/perllib/FixMyStreet/DB/Result/User.pm
@@ -26,6 +26,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 },
"password",
{ data_type => "text", default_value => "", is_nullable => 0 },
+ "flagged",
+ { data_type => "boolean", default_value => \"false", is_nullable => 0 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint("users_email_key", ["email"]);