aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r--perllib/FixMyStreet/DB/Result/Body.pm10
-rw-r--r--perllib/FixMyStreet/DB/Result/Contact.pm16
-rw-r--r--perllib/FixMyStreet/DB/Result/ContactsHistory.pm6
3 files changed, 22 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm
index 76835cbde..6071ef33e 100644
--- a/perllib/FixMyStreet/DB/Result/Body.pm
+++ b/perllib/FixMyStreet/DB/Result/Body.pm
@@ -50,10 +50,16 @@ __PACKAGE__->belongs_to(
on_update => "CASCADE",
},
);
+__PACKAGE__->has_many(
+ "contacts",
+ "FixMyStreet::DB::Result::Contact",
+ { "foreign.body_id" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
-# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-12 16:29:16
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7G4lkjrgUBXKmadSuK8emA
+# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-13 12:34:57
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YiDf4mhoPlG5cnxCIrqZxw
# You can replace this text with custom code or comments, and it will be preserved on regeneration
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm
index 0fef2f56b..b9bfd8610 100644
--- a/perllib/FixMyStreet/DB/Result/Contact.pm
+++ b/perllib/FixMyStreet/DB/Result/Contact.pm
@@ -18,8 +18,8 @@ __PACKAGE__->add_columns(
is_nullable => 0,
sequence => "contacts_id_seq",
},
- "area_id",
- { data_type => "integer", is_nullable => 0 },
+ "body_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"category",
{ data_type => "text", default_value => "Other", is_nullable => 0 },
"email",
@@ -48,11 +48,17 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 },
);
__PACKAGE__->set_primary_key("id");
-__PACKAGE__->add_unique_constraint("contacts_area_id_category_idx", ["area_id", "category"]);
+__PACKAGE__->add_unique_constraint("contacts_body_id_category_idx", ["body_id", "category"]);
+__PACKAGE__->belongs_to(
+ "body",
+ "FixMyStreet::DB::Result::Body",
+ { id => "body_id" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
-# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-10 15:33:48
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:T1jcv40rbTqZbwDziGTYCA
+# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-13 12:34:33
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:imXq3EtrC0FrQwj+E2xfBw
__PACKAGE__->filter_column(
extra => {
diff --git a/perllib/FixMyStreet/DB/Result/ContactsHistory.pm b/perllib/FixMyStreet/DB/Result/ContactsHistory.pm
index deb00fb95..7126d91c9 100644
--- a/perllib/FixMyStreet/DB/Result/ContactsHistory.pm
+++ b/perllib/FixMyStreet/DB/Result/ContactsHistory.pm
@@ -20,7 +20,7 @@ __PACKAGE__->add_columns(
},
"contact_id",
{ data_type => "integer", is_nullable => 0 },
- "area_id",
+ "body_id",
{ data_type => "integer", is_nullable => 0 },
"category",
{ data_type => "text", default_value => "Other", is_nullable => 0 },
@@ -40,8 +40,8 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("contacts_history_id");
-# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dN2ueIDoP3d/+Mg1UDqsMw
+# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-12 16:37:16
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sxflEBBn0Mn0s3MroWnWFA
# You can replace this text with custom code or comments, and it will be preserved on regeneration