diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-17 14:19:15 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-17 14:19:15 +0100 |
commit | 7372afa95033cc39546664ad7a4f335bb7ea3e53 (patch) | |
tree | ed2a679224841ad47426a34c256b7dbcf0900fe0 | |
parent | 57bbee2f0fd4808de5174ff66d74d5694a06c686 (diff) |
add comment table in to generated DB files and regenerate
-rwxr-xr-x | db/rerun_dbic_loader.pl | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 68 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Contact.pm | 54 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 147 |
4 files changed, 175 insertions, 95 deletions
diff --git a/db/rerun_dbic_loader.pl b/db/rerun_dbic_loader.pl index bef91a341..a21fea301 100755 --- a/db/rerun_dbic_loader.pl +++ b/db/rerun_dbic_loader.pl @@ -16,7 +16,6 @@ my @tables_to_ignore = ( 'admin_log', # 'alert_sent', # 'alert_type', # - 'comment', # 'contacts_history', # 'debugdate', # 'flickr_imported', # diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm new file mode 100644 index 000000000..557348429 --- /dev/null +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -0,0 +1,68 @@ +package FixMyStreet::DB::Result::Comment; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->load_components("FilterColumn"); +__PACKAGE__->table("comment"); +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "comment_id_seq", + }, + "problem_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "text", is_nullable => 1 }, + "email", + { data_type => "text", is_nullable => 0 }, + "website", + { data_type => "text", is_nullable => 1 }, + "created", + { + data_type => "timestamp", + default_value => \"ms_current_timestamp()", + is_nullable => 0, + }, + "confirmed", + { data_type => "timestamp", is_nullable => 1 }, + "text", + { data_type => "text", is_nullable => 0 }, + "photo", + { data_type => "bytea", is_nullable => 1 }, + "state", + { data_type => "text", is_nullable => 0 }, + "cobrand", + { data_type => "text", default_value => "", is_nullable => 0 }, + "lang", + { data_type => "text", default_value => "en-gb", is_nullable => 0 }, + "cobrand_data", + { data_type => "text", default_value => "", is_nullable => 0 }, + "mark_fixed", + { data_type => "boolean", is_nullable => 0 }, + "mark_open", + { data_type => "boolean", default_value => \"false", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("id"); +__PACKAGE__->belongs_to( + "problem", + "FixMyStreet::DB::Result::Problem", + { id => "problem_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-05-17 14:18:03 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CVW3SYgW5Us142cj8zTafg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index 5a993a773..798edf88f 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -11,35 +11,35 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components("FilterColumn"); __PACKAGE__->table("contacts"); __PACKAGE__->add_columns( - "area_id", - { data_type => "integer", is_nullable => 0 }, - "category", - { data_type => "text", default_value => "Other", is_nullable => 0 }, - "email", - { data_type => "text", is_nullable => 0 }, - "confirmed", - { data_type => "boolean", is_nullable => 0 }, - "deleted", - { data_type => "boolean", is_nullable => 0 }, - "editor", - { data_type => "text", is_nullable => 0 }, - "whenedited", - { data_type => "timestamp", is_nullable => 0 }, - "note", - { data_type => "text", is_nullable => 0 }, - "id", - { - data_type => "integer", - is_auto_increment => 1, - is_nullable => 0, - sequence => "contacts_id_seq", - }, + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "contacts_id_seq", + }, + "area_id", + { data_type => "integer", is_nullable => 0 }, + "category", + { data_type => "text", default_value => "Other", is_nullable => 0 }, + "email", + { data_type => "text", is_nullable => 0 }, + "confirmed", + { data_type => "boolean", is_nullable => 0 }, + "deleted", + { data_type => "boolean", is_nullable => 0 }, + "editor", + { data_type => "text", is_nullable => 0 }, + "whenedited", + { data_type => "timestamp", is_nullable => 0 }, + "note", + { data_type => "text", is_nullable => 0 }, ); __PACKAGE__->set_primary_key("id"); -__PACKAGE__->add_unique_constraint( "contacts_area_id_category_idx", - [ "area_id", "category" ] ); +__PACKAGE__->add_unique_constraint("contacts_area_id_category_idx", ["area_id", "category"]); -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-03-24 17:36:08 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u6kRlRfgwAiCqmGhj6io5A + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-05-17 14:18:03 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:l1vxwfXLgSjvE+YB/gh7iQ 1; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index bafad4ec0..ca13f7130 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -11,78 +11,91 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components("FilterColumn"); __PACKAGE__->table("problem"); __PACKAGE__->add_columns( - "id", - { - data_type => "integer", - is_auto_increment => 1, - is_nullable => 0, - sequence => "problem_id_seq", - }, - "postcode", - { data_type => "text", is_nullable => 0 }, - "council", - { data_type => "text", is_nullable => 1 }, - "areas", - { data_type => "text", is_nullable => 0 }, - "category", - { data_type => "text", default_value => "Other", is_nullable => 0 }, - "title", - { data_type => "text", is_nullable => 0 }, - "detail", - { data_type => "text", is_nullable => 0 }, - "photo", - { data_type => "bytea", is_nullable => 1 }, - "used_map", - { data_type => "boolean", is_nullable => 0 }, - "name", - { data_type => "text", is_nullable => 0 }, - "anonymous", - { data_type => "boolean", is_nullable => 0 }, - "created", - { - data_type => "timestamp", - default_value => \"ms_current_timestamp()", - is_nullable => 0, - }, - "confirmed", - { data_type => "timestamp", is_nullable => 1 }, - "state", - { data_type => "text", is_nullable => 0 }, - "lang", - { data_type => "text", default_value => "en-gb", is_nullable => 0 }, - "service", - { data_type => "text", default_value => "", is_nullable => 0 }, - "cobrand", - { data_type => "text", default_value => "", is_nullable => 0 }, - "cobrand_data", - { data_type => "text", default_value => "", is_nullable => 0 }, - "lastupdate", - { - data_type => "timestamp", - default_value => \"ms_current_timestamp()", - is_nullable => 0, - }, - "whensent", - { data_type => "timestamp", is_nullable => 1 }, - "send_questionnaire", - { data_type => "boolean", default_value => \"true", is_nullable => 0 }, - "latitude", - { data_type => "double precision", is_nullable => 0 }, - "longitude", - { data_type => "double precision", is_nullable => 0 }, - "user_id", - { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "problem_id_seq", + }, + "postcode", + { data_type => "text", is_nullable => 0 }, + "latitude", + { data_type => "double precision", is_nullable => 0 }, + "longitude", + { data_type => "double precision", is_nullable => 0 }, + "council", + { data_type => "text", is_nullable => 1 }, + "areas", + { data_type => "text", is_nullable => 0 }, + "category", + { data_type => "text", default_value => "Other", is_nullable => 0 }, + "title", + { data_type => "text", is_nullable => 0 }, + "detail", + { data_type => "text", is_nullable => 0 }, + "photo", + { data_type => "bytea", is_nullable => 1 }, + "used_map", + { data_type => "boolean", is_nullable => 0 }, + "user_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "text", is_nullable => 0 }, + "anonymous", + { data_type => "boolean", is_nullable => 0 }, + "external_id", + { data_type => "text", is_nullable => 1 }, + "external_body", + { data_type => "text", is_nullable => 1 }, + "external_team", + { data_type => "text", is_nullable => 1 }, + "created", + { + data_type => "timestamp", + default_value => \"ms_current_timestamp()", + is_nullable => 0, + }, + "confirmed", + { data_type => "timestamp", is_nullable => 1 }, + "state", + { data_type => "text", is_nullable => 0 }, + "lang", + { data_type => "text", default_value => "en-gb", is_nullable => 0 }, + "service", + { data_type => "text", default_value => "", is_nullable => 0 }, + "cobrand", + { data_type => "text", default_value => "", is_nullable => 0 }, + "cobrand_data", + { data_type => "text", default_value => "", is_nullable => 0 }, + "lastupdate", + { + data_type => "timestamp", + default_value => \"ms_current_timestamp()", + is_nullable => 0, + }, + "whensent", + { data_type => "timestamp", is_nullable => 1 }, + "send_questionnaire", + { data_type => "boolean", default_value => \"true", is_nullable => 0 }, ); __PACKAGE__->set_primary_key("id"); +__PACKAGE__->has_many( + "comments", + "FixMyStreet::DB::Result::Comment", + { "foreign.problem_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); __PACKAGE__->belongs_to( - "user", - "FixMyStreet::DB::Result::User", - { id => "user_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + "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-03-24 17:36:08 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+a9n7IKg3yFdgxNIbo3SGg + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-05-17 14:18:03 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LyIl4gkdC2Lo2vuddrEByQ =head2 check_for_errors |