diff options
-rw-r--r-- | db/schema.sql | 10 | ||||
-rw-r--r-- | db/schema_0007-add-comment-problem-state.sql | 16 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 6 |
3 files changed, 30 insertions, 2 deletions
diff --git a/db/schema.sql b/db/schema.sql index 984ceb690..21fc3371a 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -287,6 +287,16 @@ create table comment ( cobrand_data text not null default '' check (cobrand_data ~* '^[a-z0-9]*$'), -- Extra data used in cobranded versions of the site mark_fixed boolean not null, mark_open boolean not null default 'f' + problem_state text check ( + problem_state = 'confirmed' + or problem_state = 'investigating' + or problem_state = 'planned' + or problem_state = 'in progress' + or problem_state = 'closed' + 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? ); diff --git a/db/schema_0007-add-comment-problem-state.sql b/db/schema_0007-add-comment-problem-state.sql new file mode 100644 index 000000000..8fa361d83 --- /dev/null +++ b/db/schema_0007-add-comment-problem-state.sql @@ -0,0 +1,16 @@ +begin; + + ALTER TABLE comment ADD column problem_state text; + + ALTER TABLE comment ADD CONSTRAINT problem_state_check CHECK ( + problem_state = 'confirmed' + or problem_state = 'investigating' + or problem_state = 'planned' + or problem_state = 'in progress' + or problem_state = 'closed' + or problem_state = 'fixed' + or problem_state = 'fixed - council' + or problem_state = 'fixed - user' + ); + +commit; diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 68175dead..81aa18b95 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -52,6 +52,8 @@ __PACKAGE__->add_columns( { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "anonymous", { data_type => "boolean", is_nullable => 0 }, + "problem_state", + { data_type => "text", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to( @@ -68,8 +70,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-05-24 15:32:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:71bSUgPf3uW607g2EGl/Vw +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-06-23 14:25:34 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:scnPU5RAGLnT0fY1gM6Z5A use DateTime::TimeZone; use Image::Size; |