aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/schema.sql9
-rw-r--r--db/schema_0016-add_whensent_and_send_fail_to_comment.sql11
-rw-r--r--db/schema_0017-add_send_comments_to_open311conf.sql6
-rw-r--r--perllib/FixMyStreet/DB/Result/Comment.pm12
-rw-r--r--perllib/FixMyStreet/DB/Result/Open311conf.pm6
5 files changed, 38 insertions, 6 deletions
diff --git a/db/schema.sql b/db/schema.sql
index aa008ce02..74b2eade6 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -312,7 +312,11 @@ create table comment (
-- other fields? one to indicate whether this was written by the council
-- and should be highlighted in the display?
external_id text,
- extra text
+ extra text,
+ send_fail_count integer not null default 0,
+ send_fail_reason text,
+ send_fail_timestamp timestamp,
+ whensent timestamp
);
create index comment_user_id_idx on comment(user_id);
@@ -427,5 +431,6 @@ create table open311conf (
endpoint text not null,
jurisdiction text,
api_key text,
- send_method text
+ send_method text,
+ send_comments boolean not null default 'f'
);
diff --git a/db/schema_0016-add_whensent_and_send_fail_to_comment.sql b/db/schema_0016-add_whensent_and_send_fail_to_comment.sql
new file mode 100644
index 000000000..8d1426db0
--- /dev/null
+++ b/db/schema_0016-add_whensent_and_send_fail_to_comment.sql
@@ -0,0 +1,11 @@
+begin;
+
+ALTER table comment
+ ADD column send_fail_count integer not null default 0;
+ALTER table comment
+ ADD column send_fail_reason text;
+ALTER table comment
+ ADD column send_fail_timestamp timestamp;
+ALTER table comment
+ ADD column when_sent timestamp;
+commit;
diff --git a/db/schema_0017-add_send_comments_to_open311conf.sql b/db/schema_0017-add_send_comments_to_open311conf.sql
new file mode 100644
index 000000000..0ee015575
--- /dev/null
+++ b/db/schema_0017-add_send_comments_to_open311conf.sql
@@ -0,0 +1,6 @@
+begin;
+
+ALTER table open311conf
+ ADD column send_comments BOOL NOT NULL DEFAULT 'f';
+
+commit;
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm
index 1775521d3..0af24e6d5 100644
--- a/perllib/FixMyStreet/DB/Result/Comment.pm
+++ b/perllib/FixMyStreet/DB/Result/Comment.pm
@@ -58,6 +58,14 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 },
"extra",
{ data_type => "text", is_nullable => 1 },
+ "send_fail_count",
+ { 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 },
+ "when_sent",
+ { data_type => "timestamp", is_nullable => 1 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to(
@@ -74,8 +82,8 @@ __PACKAGE__->belongs_to(
);
-# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-23 14:36:14
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QUnX6SvdgvK/4GlCzoMU6Q
+# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-26 13:29:28
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UDoQkVj1Gvow4fZ1yO94jA
__PACKAGE__->filter_column(
extra => {
diff --git a/perllib/FixMyStreet/DB/Result/Open311conf.pm b/perllib/FixMyStreet/DB/Result/Open311conf.pm
index 742a12ebd..d9666ca26 100644
--- a/perllib/FixMyStreet/DB/Result/Open311conf.pm
+++ b/perllib/FixMyStreet/DB/Result/Open311conf.pm
@@ -28,13 +28,15 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 },
"send_method",
{ data_type => "text", is_nullable => 1 },
+ "send_comments",
+ { data_type => "boolean", default_value => \"false", is_nullable => 0 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint("open311conf_area_id_key", ["area_id"]);
-# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ClYnPB2gsKapnfHuco5d/w
+# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-26 13:10:56
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u4BOIa2AayJq99eKAzZfJw
# You can replace this text with custom code or comments, and it will be preserved on regeneration