diff options
author | Struan Donald <struan@exo.org.uk> | 2012-03-19 18:07:01 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-03-19 18:07:01 +0000 |
commit | 246303b1e234fbde17775054859af4d6fe7e4a80 (patch) | |
tree | 057716b518b7a5248d9d582b9c2a4a6055038790 | |
parent | b0caccf00ebbef40fbaf4a57c537c31f8393aa4f (diff) |
add external id to comments table
-rw-r--r-- | db/schema.sql | 3 | ||||
-rw-r--r-- | db/schema_0013-add_external_id_to_comment.sql | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 20 |
3 files changed, 19 insertions, 10 deletions
diff --git a/db/schema.sql b/db/schema.sql index 395d1c07b..d54cecd5a 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -303,9 +303,10 @@ create table comment ( or problem_state = 'fixed' or problem_state = 'fixed - council' or problem_state = 'fixed - user' - ) + ), -- other fields? one to indicate whether this was written by the council -- and should be highlighted in the display? + external_id text ); create index comment_user_id_idx on comment(user_id); diff --git a/db/schema_0013-add_external_id_to_comment.sql b/db/schema_0013-add_external_id_to_comment.sql new file mode 100644 index 000000000..a1cd11c3f --- /dev/null +++ b/db/schema_0013-add_external_id_to_comment.sql @@ -0,0 +1,6 @@ +begin; + +ALTER TABLE comment + ADD COLUMN external_id TEXT; + +commit; diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 195fe4019..d3aecc091 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -1,3 +1,4 @@ +use utf8; package FixMyStreet::DB::Result::Comment; # Created by DBIx::Class::Schema::Loader @@ -7,7 +8,6 @@ use strict; use warnings; use base 'DBIx::Class::Core'; - __PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); __PACKAGE__->table("comment"); __PACKAGE__->add_columns( @@ -54,24 +54,26 @@ __PACKAGE__->add_columns( { data_type => "boolean", is_nullable => 0 }, "problem_state", { data_type => "text", is_nullable => 1 }, + "external_id", + { data_type => "text", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to( - "user", - "FixMyStreet::DB::Result::User", - { id => "user_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, -); -__PACKAGE__->belongs_to( "problem", "FixMyStreet::DB::Result::Problem", { id => "problem_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +__PACKAGE__->belongs_to( + "user", + "FixMyStreet::DB::Result::User", + { id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-06-27 10:07:32 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ilLn3dlagg5COdpZDmzrVQ +# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-19 17:32:28 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2N8KFSUsilae7mWkyHchhQ use DateTime::TimeZone; use Image::Size; |