diff options
Diffstat (limited to 'perllib')
28 files changed, 283 insertions, 185 deletions
diff --git a/perllib/DBIx/Class/FixMyStreet/InflateColumn/DateTime.pm b/perllib/DBIx/Class/FixMyStreet/InflateColumn/DateTime.pm new file mode 100644 index 000000000..f2089d5a3 --- /dev/null +++ b/perllib/DBIx/Class/FixMyStreet/InflateColumn/DateTime.pm @@ -0,0 +1,36 @@ +package DBIx::Class::FixMyStreet::InflateColumn::DateTime; + +use strict; +use warnings; +use base qw/DBIx::Class::InflateColumn::DateTime/; +use FixMyStreet; +use namespace::clean; + +sub _post_inflate_datetime { + my $self = shift; + my $dt = $self->next::method(@_); + FixMyStreet->set_time_zone($dt); + return $dt; +} + +sub _pre_deflate_datetime { + my $self = shift; + my $dt = $self->next::method(@_); + $dt->set_time_zone(FixMyStreet->local_time_zone); + return $dt; +} + +1; + +__END__ + +=head1 NAME + +DBIx::Class::FixMyStreet::InflateColumn::DateTime + +=head1 DESCRIPTION + +This acts the same as DBIx::Class::InflateColumn::DateTime, as if a +'local' timezone object was attached to every datetime column, plus +alters the timezone upon inflation to the configured timezone if it +has been set, and uses a singleton to prevent needless disc access. diff --git a/perllib/FixMyStreet/DB/Result/Abuse.pm b/perllib/FixMyStreet/DB/Result/Abuse.pm index e8e554afa..d86fbba6d 100644 --- a/perllib/FixMyStreet/DB/Result/Abuse.pm +++ b/perllib/FixMyStreet/DB/Result/Abuse.pm @@ -8,14 +8,18 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("abuse"); __PACKAGE__->add_columns("email", { data_type => "text", is_nullable => 0 }); __PACKAGE__->set_primary_key("email"); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PnQhGMx+ktK++3gWOMJBpQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K5r1cuouM4HE8juAlX5icA # 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/AdminLog.pm b/perllib/FixMyStreet/DB/Result/AdminLog.pm index 1c9bd3a63..4c2a49bf4 100644 --- a/perllib/FixMyStreet/DB/Result/AdminLog.pm +++ b/perllib/FixMyStreet/DB/Result/AdminLog.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("admin_log"); __PACKAGE__->add_columns( "id", @@ -54,7 +58,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-07-20 14:38:36 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:y2xZ4BDv7H+f4vbIZyNflw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OVDplvQDv+zTC2L8Mir3Rg 1; diff --git a/perllib/FixMyStreet/DB/Result/Alert.pm b/perllib/FixMyStreet/DB/Result/Alert.pm index 2a52a7bca..31935bc32 100644 --- a/perllib/FixMyStreet/DB/Result/Alert.pm +++ b/perllib/FixMyStreet/DB/Result/Alert.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("alert"); __PACKAGE__->add_columns( "id", @@ -65,8 +69,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2015-08-13 16:33:38 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5RNyB430T8PqtFlmGV/MUg +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6pe/RralQASq3F7b/zZVkg # You can replace this text with custom code or comments, and it will be preserved on regeneration @@ -75,17 +79,6 @@ use namespace::clean -except => [ 'meta' ]; with 'FixMyStreet::Roles::Abuser'; -my $stz = sub { - my ( $orig, $self ) = ( shift, shift ); - my $s = $self->$orig(@_); - return $s unless $s && UNIVERSAL::isa($s, "DateTime"); - FixMyStreet->set_time_zone($s); - return $s; -}; - -around whensubscribed => $stz; -around whendisabled => $stz; - =head2 confirm $alert->confirm(); diff --git a/perllib/FixMyStreet/DB/Result/AlertSent.pm b/perllib/FixMyStreet/DB/Result/AlertSent.pm index 83043a33b..f3fd4743e 100644 --- a/perllib/FixMyStreet/DB/Result/AlertSent.pm +++ b/perllib/FixMyStreet/DB/Result/AlertSent.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("alert_sent"); __PACKAGE__->add_columns( "alert_id", @@ -31,8 +35,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2015-08-13 16:33:38 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/+Vodu8VJxJ0EY9P3Qjjjw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5BIIde9jkqYzDd7vEtL1PQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/AlertType.pm b/perllib/FixMyStreet/DB/Result/AlertType.pm index 3aa9677e0..253d3ef8c 100644 --- a/perllib/FixMyStreet/DB/Result/AlertType.pm +++ b/perllib/FixMyStreet/DB/Result/AlertType.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("alert_type"); __PACKAGE__->add_columns( "ref", @@ -47,8 +51,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KDBYzNEAM5lPvZjb9cv22g +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hLHv/QSFUvn5pVs2K2h2qQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm index 37164c990..686e451d0 100644 --- a/perllib/FixMyStreet/DB/Result/Body.pm +++ b/perllib/FixMyStreet/DB/Result/Body.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("body"); __PACKAGE__->add_columns( "id", @@ -18,6 +22,12 @@ __PACKAGE__->add_columns( is_nullable => 0, sequence => "body_id_seq", }, + "name", + { data_type => "text", is_nullable => 0 }, + "external_url", + { data_type => "text", is_nullable => 1 }, + "parent", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "endpoint", { data_type => "text", is_nullable => 1 }, "jurisdiction", @@ -36,20 +46,14 @@ __PACKAGE__->add_columns( { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "send_extended_statuses", { data_type => "boolean", default_value => \"false", is_nullable => 0 }, - "name", - { data_type => "text", is_nullable => 0 }, - "parent", - { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, - "deleted", - { data_type => "boolean", default_value => \"false", is_nullable => 0 }, - "external_url", - { data_type => "text", is_nullable => 1 }, "fetch_problems", { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "blank_updates_permitted", - { data_type => "boolean", default_value => \"false", is_nullable => 1 }, + { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "convert_latlong", { data_type => "boolean", default_value => \"false", is_nullable => 0 }, + "deleted", + { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "extra", { data_type => "text", is_nullable => 1 }, ); @@ -126,8 +130,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2018-04-05 14:29:33 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HV8IM2C1ErrpvXoRTZ1B1Q +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:us6PjQwLcPVI8CVdoQlnpg __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); __PACKAGE__->rabx_column('extra'); diff --git a/perllib/FixMyStreet/DB/Result/BodyArea.pm b/perllib/FixMyStreet/DB/Result/BodyArea.pm index 4447777dc..043390b42 100644 --- a/perllib/FixMyStreet/DB/Result/BodyArea.pm +++ b/perllib/FixMyStreet/DB/Result/BodyArea.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("body_areas"); __PACKAGE__->add_columns( "body_id", @@ -25,8 +29,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+hzie6kHleUBoEt199c/nQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gRcj2YH5kIX4HCNejN/lQg __PACKAGE__->set_primary_key(__PACKAGE__->columns); diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 31e9f3e63..9074b9b6c 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("comment"); __PACKAGE__->add_columns( "id", @@ -89,8 +93,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2018-11-20 16:13:59 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5w/4Og9uCy54lGyyJiLzxA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iKLyIv3adGsR90fPKUXNAg # __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); @@ -105,17 +109,6 @@ with 'FixMyStreet::Roles::Abuser', 'FixMyStreet::Roles::Moderation', 'FixMyStreet::Roles::PhotoSet'; -my $stz = sub { - my ( $orig, $self ) = ( shift, shift ); - my $s = $self->$orig(@_); - return $s unless $s && UNIVERSAL::isa($s, "DateTime"); - FixMyStreet->set_time_zone($s); - return $s; -}; - -around created => $stz; -around confirmed => $stz; - =head2 get_cobrand_logged Get a cobrand object for the cobrand the update was made on. diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index 81f770f8f..8fa515667 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("contacts"); __PACKAGE__->add_columns( "id", @@ -24,6 +28,8 @@ __PACKAGE__->add_columns( { data_type => "text", default_value => "Other", is_nullable => 0 }, "email", { data_type => "text", is_nullable => 0 }, + "state", + { data_type => "text", is_nullable => 0 }, "editor", { data_type => "text", is_nullable => 0 }, "whenedited", @@ -42,8 +48,6 @@ __PACKAGE__->add_columns( { data_type => "text", default_value => "", is_nullable => 1 }, "send_method", { data_type => "text", is_nullable => 1 }, - "state", - { data_type => "text", is_nullable => 0 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->add_unique_constraint("contacts_body_id_category_idx", ["body_id", "category"]); @@ -73,8 +77,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-07-08 20:45:04 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t/VtPP11R8bbqPZdEVXffw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:53shN+K8QHeiBTDsv2sPvQ __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); __PACKAGE__->rabx_column('extra'); diff --git a/perllib/FixMyStreet/DB/Result/ContactDefectType.pm b/perllib/FixMyStreet/DB/Result/ContactDefectType.pm index 2199f0b42..74af8e45b 100644 --- a/perllib/FixMyStreet/DB/Result/ContactDefectType.pm +++ b/perllib/FixMyStreet/DB/Result/ContactDefectType.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("contact_defect_types"); __PACKAGE__->add_columns( "id", @@ -38,8 +42,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-02-13 15:11:11 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VIczmM0OXXpWgQVpop3SMw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zDbsla2LajNISa4Y4bF+Yg # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/ContactResponsePriority.pm b/perllib/FixMyStreet/DB/Result/ContactResponsePriority.pm index d5afd75a7..ea8f11e4c 100644 --- a/perllib/FixMyStreet/DB/Result/ContactResponsePriority.pm +++ b/perllib/FixMyStreet/DB/Result/ContactResponsePriority.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("contact_response_priorities"); __PACKAGE__->add_columns( "id", @@ -38,8 +42,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-09-06 15:33:04 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kM/9jY1QSgakyPTvutS+hw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:47KmW1urSfZH3zvJkem8VQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm b/perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm index 3c777533c..39d66a2bc 100644 --- a/perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm +++ b/perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("contact_response_templates"); __PACKAGE__->add_columns( "id", @@ -38,8 +42,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-08-24 11:29:04 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d6niNsxi2AsijhvJSuQeKw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RmULAGRsBk57AlaEr8U8nw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/ContactsHistory.pm b/perllib/FixMyStreet/DB/Result/ContactsHistory.pm index c90bb9d66..db8db0fe6 100644 --- a/perllib/FixMyStreet/DB/Result/ContactsHistory.pm +++ b/perllib/FixMyStreet/DB/Result/ContactsHistory.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("contacts_history"); __PACKAGE__->add_columns( "contacts_history_id", @@ -26,20 +30,20 @@ __PACKAGE__->add_columns( { data_type => "text", default_value => "Other", is_nullable => 0 }, "email", { data_type => "text", is_nullable => 0 }, + "state", + { data_type => "text", is_nullable => 0 }, "editor", { data_type => "text", is_nullable => 0 }, "whenedited", { data_type => "timestamp", is_nullable => 0 }, "note", { data_type => "text", is_nullable => 0 }, - "state", - { data_type => "text", is_nullable => 0 }, ); __PACKAGE__->set_primary_key("contacts_history_id"); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-07-08 20:45:04 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HTt0g29yXTM/WyHKN179FA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2QCahRyirxGjDO+nQ1ZoJA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/DefectType.pm b/perllib/FixMyStreet/DB/Result/DefectType.pm index a2969f59e..95110d698 100644 --- a/perllib/FixMyStreet/DB/Result/DefectType.pm +++ b/perllib/FixMyStreet/DB/Result/DefectType.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("defect_types"); __PACKAGE__->add_columns( "id", @@ -49,8 +53,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-02-13 15:11:11 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BBLjb/aAoTKJZerdYCeBMQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DKLZGVTlXeq7CXd4fOfMlA __PACKAGE__->many_to_many( contacts => 'contact_defect_types', 'contact' ); diff --git a/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm b/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm index d947c4f6b..a9ed29ad6 100644 --- a/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm +++ b/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("moderation_original_data"); __PACKAGE__->add_columns( "id", @@ -66,8 +70,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2018-11-20 16:13:59 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zFOhQnS4WfVzD7qHxaAr6w +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jOD21ppyp9e1e/pVa/RB9g use Moo; use Text::Diff; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index a222ea1f6..03213d36c 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("problem"); __PACKAGE__->add_columns( "id", @@ -20,14 +24,38 @@ __PACKAGE__->add_columns( }, "postcode", { data_type => "text", is_nullable => 0 }, + "latitude", + { data_type => "double precision", is_nullable => 0 }, + "longitude", + { data_type => "double precision", is_nullable => 0 }, + "bodies_str", + { data_type => "text", is_nullable => 1 }, + "bodies_missing", + { 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", @@ -35,57 +63,37 @@ __PACKAGE__->add_columns( is_nullable => 0, original => { default_value => \"now()" }, }, - "state", - { data_type => "text", is_nullable => 0 }, - "whensent", - { data_type => "timestamp", is_nullable => 1 }, - "used_map", - { data_type => "boolean", is_nullable => 0 }, - "bodies_str", - { data_type => "text", is_nullable => 1 }, - "anonymous", - { data_type => "boolean", is_nullable => 0 }, - "category", - { data_type => "text", default_value => "Other", is_nullable => 0 }, "confirmed", { data_type => "timestamp", is_nullable => 1 }, - "send_questionnaire", - { data_type => "boolean", default_value => \"true", is_nullable => 0 }, - "lastupdate", - { - data_type => "timestamp", - default_value => \"current_timestamp", - is_nullable => 0, - original => { default_value => \"now()" }, - }, - "areas", + "state", { data_type => "text", is_nullable => 0 }, - "service", - { data_type => "text", default_value => "", 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 }, - "latitude", - { data_type => "double precision", is_nullable => 0 }, - "longitude", - { data_type => "double precision", is_nullable => 0 }, - "external_id", - { data_type => "text", is_nullable => 1 }, - "external_body", - { data_type => "text", is_nullable => 1 }, - "external_team", + "lastupdate", + { + data_type => "timestamp", + default_value => \"current_timestamp", + is_nullable => 0, + original => { default_value => \"now()" }, + }, + "whensent", + { data_type => "timestamp", is_nullable => 1 }, + "send_questionnaire", + { data_type => "boolean", default_value => \"true", is_nullable => 0 }, + "extra", { data_type => "text", is_nullable => 1 }, - "user_id", - { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "flagged", { data_type => "boolean", default_value => \"false", is_nullable => 0 }, - "extra", - { data_type => "text", is_nullable => 1 }, "geocode", { data_type => "bytea", is_nullable => 1 }, + "response_priority_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "send_fail_count", { data_type => "integer", default_value => 0, is_nullable => 0 }, "send_fail_reason", @@ -104,10 +112,6 @@ __PACKAGE__->add_columns( { data_type => "integer", default_value => 0, is_nullable => 1 }, "subcategory", { data_type => "text", is_nullable => 1 }, - "bodies_missing", - { data_type => "text", is_nullable => 1 }, - "response_priority_id", - { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "defect_type_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, ); @@ -166,8 +170,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-02-13 15:11:11 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8zzWlJX7OQOdvrGxKuZUmg +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bo68n1AwhO21D0hRY9Yktw # Add fake relationship to stored procedure table __PACKAGE__->has_one( @@ -323,19 +327,6 @@ sub visible_states_remove { } } -my $stz = sub { - my ( $orig, $self ) = ( shift, shift ); - my $s = $self->$orig(@_); - return $s unless $s && UNIVERSAL::isa($s, "DateTime"); - FixMyStreet->set_time_zone($s); - return $s; -}; - -around created => $stz; -around confirmed => $stz; -around whensent => $stz; -around lastupdate => $stz; - around service => sub { my ( $orig, $self ) = ( shift, shift ); # service might be undef if e.g. unsaved code report diff --git a/perllib/FixMyStreet/DB/Result/Questionnaire.pm b/perllib/FixMyStreet/DB/Result/Questionnaire.pm index 6b7ab9452..846514fe8 100644 --- a/perllib/FixMyStreet/DB/Result/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/Result/Questionnaire.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("questionnaire"); __PACKAGE__->add_columns( "id", @@ -40,23 +44,12 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oL1Hk4/bNG14CY74GA75SA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dmTa+1kr1wB1PMSTQo3HBw use Moo; use namespace::clean -except => [ 'meta' ]; -my $stz = sub { - my ( $orig, $self ) = ( shift, shift ); - my $s = $self->$orig(@_); - return $s unless $s && UNIVERSAL::isa($s, "DateTime"); - FixMyStreet->set_time_zone($s); - return $s; -}; - -around whensent => $stz; -around whenanswered => $stz; - sub marks_fixed { my $self = shift; my $new_fixed = FixMyStreet::DB::Result::Problem->fixed_states()->{$self->new_state}; diff --git a/perllib/FixMyStreet/DB/Result/ResponsePriority.pm b/perllib/FixMyStreet/DB/Result/ResponsePriority.pm index df54cfa08..cb18a442e 100644 --- a/perllib/FixMyStreet/DB/Result/ResponsePriority.pm +++ b/perllib/FixMyStreet/DB/Result/ResponsePriority.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("response_priorities"); __PACKAGE__->add_columns( "id", @@ -20,10 +24,10 @@ __PACKAGE__->add_columns( }, "body_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, - "name", - { data_type => "text", is_nullable => 0 }, "deleted", { data_type => "boolean", default_value => \"false", is_nullable => 0 }, + "name", + { data_type => "text", is_nullable => 0 }, "description", { data_type => "text", is_nullable => 1 }, "external_id", @@ -53,8 +57,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-09-12 09:32:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JBIHFnaLvXCAUjgwTSB3CQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZCnlu9d3mEwzsJJPiMpUCQ __PACKAGE__->many_to_many( contacts => 'contact_response_priorities', 'contact' ); diff --git a/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm b/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm index 73e0d898e..e9c129e4c 100644 --- a/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm +++ b/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("response_templates"); __PACKAGE__->add_columns( "id", @@ -54,8 +58,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-03-22 11:18:36 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:p0+/jFma6H9eZ3MZAJQRaQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2ovSQI1Mgmn1JWMEGw24mQ __PACKAGE__->many_to_many( contacts => 'contact_response_templates', 'contact' ); diff --git a/perllib/FixMyStreet/DB/Result/Secret.pm b/perllib/FixMyStreet/DB/Result/Secret.pm index 449dfec0e..17732d1c9 100644 --- a/perllib/FixMyStreet/DB/Result/Secret.pm +++ b/perllib/FixMyStreet/DB/Result/Secret.pm @@ -8,13 +8,17 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("secret"); __PACKAGE__->add_columns("secret", { data_type => "text", is_nullable => 0 }); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9XiWSKJ1PD3LSYjrSA3drw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IjH+I3GvgYgLyG+rliQVxg # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/Session.pm b/perllib/FixMyStreet/DB/Result/Session.pm index a478c5444..7461f7cd6 100644 --- a/perllib/FixMyStreet/DB/Result/Session.pm +++ b/perllib/FixMyStreet/DB/Result/Session.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("sessions"); __PACKAGE__->add_columns( "id", @@ -21,8 +25,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MVmCn4gLQWXTDIIaDHiVmA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Pywdv4Jx/uvQX6zF0UrFBA use Storable; use MIME::Base64; diff --git a/perllib/FixMyStreet/DB/Result/State.pm b/perllib/FixMyStreet/DB/Result/State.pm index b8a35d42b..f6cbd573b 100644 --- a/perllib/FixMyStreet/DB/Result/State.pm +++ b/perllib/FixMyStreet/DB/Result/State.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("state"); __PACKAGE__->add_columns( "id", @@ -30,8 +34,8 @@ __PACKAGE__->add_unique_constraint("state_label_key", ["label"]); __PACKAGE__->add_unique_constraint("state_name_key", ["name"]); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-08-22 15:17:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dvtAOpeYqEF9T3otHHgLqw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vG7A4UVYLsXLnhMZ0roV5Q use Moo; use namespace::clean; diff --git a/perllib/FixMyStreet/DB/Result/Token.pm b/perllib/FixMyStreet/DB/Result/Token.pm index a60e23839..3e6573d8e 100644 --- a/perllib/FixMyStreet/DB/Result/Token.pm +++ b/perllib/FixMyStreet/DB/Result/Token.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("token"); __PACKAGE__->add_columns( "scope", @@ -28,8 +32,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("scope", "token"); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2015-08-13 16:33:38 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HkvzOY5STjOdXN64hxg5NA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:b+YjiisJdWRbCRrLNuMGiw use mySociety::AuthToken; diff --git a/perllib/FixMyStreet/DB/Result/Translation.pm b/perllib/FixMyStreet/DB/Result/Translation.pm index fafc7ccf1..e30604bc0 100644 --- a/perllib/FixMyStreet/DB/Result/Translation.pm +++ b/perllib/FixMyStreet/DB/Result/Translation.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("translation"); __PACKAGE__->add_columns( "id", @@ -36,8 +40,8 @@ __PACKAGE__->add_unique_constraint( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-07-14 23:24:32 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:///VNqg4BOuO29xKhnY8vw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TaUNrkZDLs7Tbf8PgGyPSQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 546867c34..5908f0b42 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("users"); __PACKAGE__->add_columns( "id", @@ -56,10 +60,10 @@ __PACKAGE__->add_columns( { data_type => "bigint", is_nullable => 1 }, "facebook_id", { data_type => "bigint", is_nullable => 1 }, - "area_ids", - { data_type => "integer[]", is_nullable => 1 }, "extra", { data_type => "text", is_nullable => 1 }, + "area_ids", + { data_type => "integer[]", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->add_unique_constraint("users_facebook_id_key", ["facebook_id"]); @@ -119,8 +123,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-02-12 15:14:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4NBO3A+LfZXOh4Kj/II2LQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5AiItinC1TPwJyxQDa7rsg # These are not fully unique constraints (they only are when the *_verified # is true), but this is managed in ResultSet::User's find() wrapper. diff --git a/perllib/FixMyStreet/DB/Result/UserBodyPermission.pm b/perllib/FixMyStreet/DB/Result/UserBodyPermission.pm index a118a1996..a228a41bb 100644 --- a/perllib/FixMyStreet/DB/Result/UserBodyPermission.pm +++ b/perllib/FixMyStreet/DB/Result/UserBodyPermission.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("user_body_permissions"); __PACKAGE__->add_columns( "id", @@ -44,8 +48,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2014-06-05 15:46:02 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IWy2rYBU7WP6MyIkLYsc9Q +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Itry3jr8zO46KNklQdb7vA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/UserPlannedReport.pm b/perllib/FixMyStreet/DB/Result/UserPlannedReport.pm index 1e893c7a9..9323e03ef 100644 --- a/perllib/FixMyStreet/DB/Result/UserPlannedReport.pm +++ b/perllib/FixMyStreet/DB/Result/UserPlannedReport.pm @@ -8,7 +8,11 @@ use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn"); +__PACKAGE__->load_components( + "FilterColumn", + "FixMyStreet::InflateColumn::DateTime", + "EncodedColumn", +); __PACKAGE__->table("user_planned_reports"); __PACKAGE__->add_columns( "id", @@ -47,8 +51,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-07-20 15:03:08 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mv7koDhvZSBW/4aQivtpAQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JpeR3k8BTlNAhnhrBeQWAQ # You can replace this text with custom code or comments, and it will be preserved on regeneration |