aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r--perllib/FixMyStreet/DB/Result/Contact.pm12
-rw-r--r--perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm46
-rw-r--r--perllib/FixMyStreet/DB/Result/ResponseTemplate.pm13
3 files changed, 67 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm
index 58d8e58de..ea9b656aa 100644
--- a/perllib/FixMyStreet/DB/Result/Contact.pm
+++ b/perllib/FixMyStreet/DB/Result/Contact.pm
@@ -55,10 +55,16 @@ __PACKAGE__->belongs_to(
{ id => "body_id" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
+__PACKAGE__->has_many(
+ "contact_response_templates",
+ "FixMyStreet::DB::Result::ContactResponseTemplate",
+ { "foreign.contact_id" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
-# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hq/BFHDEu4OUI4MSy3OyHg
+# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-08-24 11:29:04
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CXUabm3Yd11OoIYJceSPag
__PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn");
__PACKAGE__->rabx_column('extra');
@@ -68,6 +74,8 @@ use namespace::clean -except => [ 'meta' ];
with 'FixMyStreet::Roles::Extra';
+__PACKAGE__->many_to_many( response_templates => 'contact_response_templates', 'response_template' );
+
sub get_metadata_for_input {
my $self = shift;
my $id_field = $self->id_field;
diff --git a/perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm b/perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm
new file mode 100644
index 000000000..3c777533c
--- /dev/null
+++ b/perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm
@@ -0,0 +1,46 @@
+use utf8;
+package FixMyStreet::DB::Result::ContactResponseTemplate;
+
+# 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", "InflateColumn::DateTime", "EncodedColumn");
+__PACKAGE__->table("contact_response_templates");
+__PACKAGE__->add_columns(
+ "id",
+ {
+ data_type => "integer",
+ is_auto_increment => 1,
+ is_nullable => 0,
+ sequence => "contact_response_templates_id_seq",
+ },
+ "contact_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "response_template_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->belongs_to(
+ "contact",
+ "FixMyStreet::DB::Result::Contact",
+ { id => "contact_id" },
+ { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
+);
+__PACKAGE__->belongs_to(
+ "response_template",
+ "FixMyStreet::DB::Result::ResponseTemplate",
+ { id => "response_template_id" },
+ { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-08-24 11:29:04
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d6niNsxi2AsijhvJSuQeKw
+
+
+# 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/ResponseTemplate.pm b/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm
index d189bf3ec..0d4377dba 100644
--- a/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm
+++ b/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm
@@ -31,6 +31,8 @@ __PACKAGE__->add_columns(
is_nullable => 0,
original => { default_value => \"now()" },
},
+ "auto_response",
+ { data_type => "boolean", default_value => \"false", is_nullable => 0 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint("response_templates_body_id_title_key", ["body_id", "title"]);
@@ -40,11 +42,18 @@ __PACKAGE__->belongs_to(
{ id => "body_id" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
+__PACKAGE__->has_many(
+ "contact_response_templates",
+ "FixMyStreet::DB::Result::ContactResponseTemplate",
+ { "foreign.response_template_id" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
-# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-07-20 14:38:36
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ECFQLMxOFGwv7cwfHLlszw
+# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-08-24 11:29:04
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KRm0RHbtrzuxzH0S/UAsdw
+__PACKAGE__->many_to_many( contacts => 'contact_response_templates', 'contact' );
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;