diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-04-25 12:00:06 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-02 22:09:30 +0100 |
commit | cbd6ab8fd022ef26f1f96dcec98c952eed6bca8a (patch) | |
tree | b6c762d745e29698ab8bdeb0c90edfbf46c11c8d | |
parent | 1edb407cddcd26fda53066c8cc92e8e04ad003b9 (diff) |
Use EncodedColumn subclass.
30 files changed, 130 insertions, 344 deletions
diff --git a/db/rerun_dbic_loader.pl b/db/rerun_dbic_loader.pl index 6a1fe1feb..1eff12d9e 100755 --- a/db/rerun_dbic_loader.pl +++ b/db/rerun_dbic_loader.pl @@ -38,7 +38,7 @@ make_schema_at( resultset_namespace => '+FixMyStreet::DB::ResultSet', # add in some extra components - components => [ 'FilterColumn', 'FixMyStreet::InflateColumn::DateTime', 'EncodedColumn' ], + components => [ 'FilterColumn', 'FixMyStreet::InflateColumn::DateTime', 'FixMyStreet::EncodedColumn' ], }, [ FixMyStreet->dbic_connect_info ], diff --git a/perllib/DBIx/Class/EncodedColumn.pm b/perllib/DBIx/Class/EncodedColumn.pm deleted file mode 100644 index b4a08b35c..000000000 --- a/perllib/DBIx/Class/EncodedColumn.pm +++ /dev/null @@ -1,262 +0,0 @@ -package DBIx::Class::EncodedColumn; - -use strict; -use warnings; - -use base qw/DBIx::Class/; -use Sub::Name; - -__PACKAGE__->mk_classdata( '_column_encoders' ); - -our $VERSION = '0.00011'; -$VERSION = eval $VERSION; - -sub register_column { - my $self = shift; - my ($column, $info) = @_; - $self->next::method(@_); - - return unless exists $info->{encode_column} && $info->{encode_column} == 1; - $self->throw_exception("'encode_class' is a required argument.") - unless exists $info->{encode_class} && defined $info->{encode_class}; - my $class = $info->{encode_class}; - - my $args = exists $info->{encode_args} ? $info->{encode_args} : {}; - $self->throw_exception("'encode_args' must be a hashref") - unless ref $args eq 'HASH'; - - $class = join("::", 'DBIx::Class::EncodedColumn', $class); - eval "require ${class};"; - $self->throw_exception("Failed to use encode_class '${class}': $@") if $@; - - defined( my $encode_sub = eval{ $class->make_encode_sub($column, $args) }) || - $self->throw_exception("Failed to create encoder with class '$class': $@"); - $self->_column_encoders({$column => $encode_sub, %{$self->_column_encoders || {}}}); - - if ( exists $info->{encode_check_method} && $info->{encode_check_method} ){ - no strict 'refs'; - defined( my $check_sub = eval{ $class->make_check_sub($column, $args) }) || - $self->throw_exception("Failed to create checker with class '$class': $@"); - my $name = join '::', $self->result_class, $info->{encode_check_method}; - *$name = subname $name, $check_sub; - } -} - -# mySociety override to allow direct setting without double encryption -sub set_column { - my $self = shift; - return $self->next::method(@_) unless defined $_[1] and not defined $_[2]; - my $encs = $self->_column_encoders; - if(exists $encs->{$_[0]} && defined(my $encoder = $encs->{$_[0]})){ - return $self->next::method($_[0], $encoder->($_[1])); - } - $self->next::method(@_); -} - -sub new { - my($self, $attr, @rest) = @_; - my $encoders = $self->_column_encoders; - for my $col (grep { defined $encoders->{$_} } keys %$encoders ) { - next unless exists $attr->{$col} && defined $attr->{$col}; - $attr->{$col} = $encoders->{$col}->( $attr->{$col} ); - } - return $self->next::method($attr, @rest); -} - -1; - -__END__; - -=head1 NAME - -DBIx::Class::EncodedColumn - Automatically encode columns - -=head1 SYNOPSIS - -In your L<DBIx::Class> Result class -(sometimes erroneously referred to as the 'table' class): - - __PACKAGE__->load_components(qw/EncodedColumn ... Core/); - - #Digest encoder with hex format and SHA-1 algorithm - __PACKAGE__->add_columns( - 'password' => { - data_type => 'CHAR', - size => 40, - encode_column => 1, - encode_class => 'Digest', - encode_args => {algorithm => 'SHA-1', format => 'hex'}, - } - - #SHA-1 / hex encoding / generate check method - __PACKAGE__->add_columns( - 'password' => { - data_type => 'CHAR', - size => 40 + 10, - encode_column => 1, - encode_class => 'Digest', - encode_args => {algorithm => 'SHA-1', format => 'hex', salt_length => 10}, - encode_check_method => 'check_password', - } - - #MD5 / base64 encoding / generate check method - __PACKAGE__->add_columns( - 'password' => { - data_type => 'CHAR', - size => 22, - encode_column => 1, - encode_class => 'Digest', - encode_args => {algorithm => 'MD5', format => 'base64'}, - encode_check_method => 'check_password', - } - - #Eksblowfish bcrypt / cost of 8/ no key_nul / generate check method - __PACKAGE__->add_columns( - 'password' => { - data_type => 'CHAR', - size => 59, - encode_column => 1, - encode_class => 'Crypt::Eksblowfish::Bcrypt', - encode_args => { key_nul => 0, cost => 8 }, - encode_check_method => 'check_password', - } - -In your application code: - - #updating the value. - $row->password('plaintext'); - my $digest = $row->password; - - #checking against an existing value with a check_method - $row->check_password('old_password'); #true - $row->password('new_password'); - $row->check_password('new_password'); #returns true - $row->check_password('old_password'); #returns false - - -B<Note:> The component needs to be loaded I<before> Core. - -=head1 DESCRIPTION - -This L<DBIx::Class> component can be used to automatically encode a column's -contents whenever the value of that column is set. - -This module is similar to the existing L<DBIx::Class::DigestColumns>, but there -is some key differences: - -=over 4 - -=item C<DigestColumns> performs the encode operation on C<insert> and C<update>, -and C<EncodedColumn> performs the operation when the value is set, or on C<new>. - -=item C<DigestColumns> supports only algorithms of the L<Digest> family. -C<EncodedColumn> employs a set of thin wrappers around different cipher modules -to provide support for any cipher you wish to use and wrappers are very simple -to write (typically less than 30 lines). - -=item C<EncodedColumn> supports having more than one encoded column per table -and each column can use a different cipher. - -=item C<Encode> adds only one item to the namespace of the object utilizing -it (C<_column_encoders>). - -=back - -There is, unfortunately, some features that C<EncodedColumn> doesn't support. -C<DigestColumns> supports changing certain options at runtime, as well as -the option to not automatically encode values on set. The author of this module -found these options to be non-essential and omitted them by design. - -=head1 Options added to add_column - -If any one of these options is present the column will be treated as a digest -column and all of the defaults will be applied to the rest of the options. - -=head2 encode_enable => 1 - -Enable automatic encoding of column values. If this option is not set to true -any other options will become no-ops. - -=head2 encode_check_method => $method_name - -By using the encode_check_method attribute when you declare a column you -can create a check method for that column. The check method accepts a plain -text string, and returns a boolean that indicates whether the digest of the -provided value matches the current value. - -=head2 encode_class - -The class to use for encoding. Available classes are: - -=over 4 - -=item C<Crypt::Eksblowfish::Bcrypt> - uses -L<DBIx::Class::EncodedColumn::Crypt::Eksblowfish::Bcrypt> and -requires L<Crypt::Eksblowfish::Bcrypt> to be installed - -=item C<Digest> - uses L<DBIx::Class::EncodedColumn::Digest> -requires L<Digest> to be installed as well as the algorithm required -(L<Digest::SHA>, L<Digest::Whirlpool>, etc) - -=item C<Crypt::OpenPGP> - L<DBIx::Class::EncodedColumn::Crypt::OpenPGP> -and requires L<Crypt::OpenPGP> to be installed - -=back - -Please see the relevant class's documentation for information about the -specific arguments accepted by each and make sure you include the encoding -algorithm (e.g. L<Crypt::OpenPGP>) in your application's requirements. - -=head1 EXTENDED METHODS - -The following L<DBIx::Class::ResultSource> method is extended: - -=over 4 - -=item B<register_column> - Handle the options described above. - -=back - -The following L<DBIx::Class::Row> methods are extended by this module: - -=over 4 - -=item B<new> - Encode the columns on new() so that copy and create DWIM. - -=item B<set_column> - Encode values whenever column is set. - -=back - -=head1 SEE ALSO - -L<DBIx::Class::DigestColumns>, L<DBIx::Class>, L<Digest> - -=head1 AUTHOR - -Guillermo Roditi (groditi) <groditi@cpan.org> - -Inspired by the original module written by Tom Kirkpatrick (tkp) <tkp@cpan.org> -featuring contributions from Guillermo Roditi (groditi) <groditi@cpan.org> -and Marc Mims <marc@questright.com> - -=head1 CONTRIBUTORS - -jshirley - J. Shirley <cpan@coldhardcode.com> - -kentnl - Kent Fredric <kentnl@cpan.org> - -mst - Matt S Trout <mst@shadowcat.co.uk> - -wreis - Wallace reis <wreis@cpan.org> - -=head1 COPYRIGHT - -Copyright (c) 2008 - 2009 the DBIx::Class::EncodedColumn L</AUTHOR> and -L</CONTRIBUTORS> as listed above. - -=head1 LICENSE - -This library is free software and may be distributed under the same terms -as perl itself. - -=cut diff --git a/perllib/DBIx/Class/FixMyStreet/EncodedColumn.pm b/perllib/DBIx/Class/FixMyStreet/EncodedColumn.pm new file mode 100644 index 000000000..0d86c7639 --- /dev/null +++ b/perllib/DBIx/Class/FixMyStreet/EncodedColumn.pm @@ -0,0 +1,48 @@ +package DBIx::Class::FixMyStreet::EncodedColumn; + +use strict; +use warnings; + +use base qw/DBIx::Class::EncodedColumn/; + +# mySociety override to allow direct setting without double encryption +sub set_column { + my $self = shift; + return DBIx::Class::Row::set_column($self, @_) unless defined $_[1] and not defined $_[2]; + $self->next::method(@_); +} + +1; + +__END__; + +=head1 NAME + +DBIx::Class::FixMyStreet::EncodedColumn - Automatically encode columns + +=head1 SYNOPSIS + +The same as DBIx::Class::EncodedColumn, but adding an extra optional second +argument to set_column to allow skipping encryption (so if we hold an +already-hashed password, we can set it directly). + +In your application code: + + $row->password('plaintext'); + $row->password('hashed-password', 1); + +=head1 EXTENDED METHODS + +The following L<DBIx::Class::Row> methods are extended by this module: + +=over 4 + +=item B<set_column> - Encode values whenever column is set. + +=back + +=head1 SEE ALSO + +L<DBIx::Class::EncodedColumn>, L<DBIx::Class> + +=cut diff --git a/perllib/FixMyStreet/DB/Result/Abuse.pm b/perllib/FixMyStreet/DB/Result/Abuse.pm index d86fbba6d..7818eb743 100644 --- a/perllib/FixMyStreet/DB/Result/Abuse.pm +++ b/perllib/FixMyStreet/DB/Result/Abuse.pm @@ -11,15 +11,15 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::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.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K5r1cuouM4HE8juAlX5icA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6XdWpymMMUEC4WT9Yh0RLw # 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 4c2a49bf4..221690405 100644 --- a/perllib/FixMyStreet/DB/Result/AdminLog.pm +++ b/perllib/FixMyStreet/DB/Result/AdminLog.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("admin_log"); __PACKAGE__->add_columns( @@ -58,7 +58,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OVDplvQDv+zTC2L8Mir3Rg +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BLPP1KitphuY56ptaXhzgg 1; diff --git a/perllib/FixMyStreet/DB/Result/Alert.pm b/perllib/FixMyStreet/DB/Result/Alert.pm index 31935bc32..8979fa338 100644 --- a/perllib/FixMyStreet/DB/Result/Alert.pm +++ b/perllib/FixMyStreet/DB/Result/Alert.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("alert"); __PACKAGE__->add_columns( @@ -69,8 +69,8 @@ __PACKAGE__->belongs_to( ); -# 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 +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pWmsXAFvvjr4x1Q3Zsu4Cg # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/AlertSent.pm b/perllib/FixMyStreet/DB/Result/AlertSent.pm index f3fd4743e..d4e669f7f 100644 --- a/perllib/FixMyStreet/DB/Result/AlertSent.pm +++ b/perllib/FixMyStreet/DB/Result/AlertSent.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("alert_sent"); __PACKAGE__->add_columns( @@ -35,8 +35,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5BIIde9jkqYzDd7vEtL1PQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xriosaSCkOo/REOG1OxdQA # 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 253d3ef8c..3d9603008 100644 --- a/perllib/FixMyStreet/DB/Result/AlertType.pm +++ b/perllib/FixMyStreet/DB/Result/AlertType.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("alert_type"); __PACKAGE__->add_columns( @@ -51,8 +51,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hLHv/QSFUvn5pVs2K2h2qQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7JyCGS/rEvL1++p520749w # 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 686e451d0..663181746 100644 --- a/perllib/FixMyStreet/DB/Result/Body.pm +++ b/perllib/FixMyStreet/DB/Result/Body.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("body"); __PACKAGE__->add_columns( @@ -130,8 +130,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:us6PjQwLcPVI8CVdoQlnpg +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8CuxbffDaYS7TFlgff1nEg __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 043390b42..7f0956c7d 100644 --- a/perllib/FixMyStreet/DB/Result/BodyArea.pm +++ b/perllib/FixMyStreet/DB/Result/BodyArea.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("body_areas"); __PACKAGE__->add_columns( @@ -29,8 +29,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gRcj2YH5kIX4HCNejN/lQg +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VPs3e9McGNO+Dd7C4pApxw __PACKAGE__->set_primary_key(__PACKAGE__->columns); diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 9074b9b6c..5d0253ef4 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("comment"); __PACKAGE__->add_columns( @@ -93,8 +93,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iKLyIv3adGsR90fPKUXNAg +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CozqNY621I8G7kUPXi5RoQ # __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index 8fa515667..17620f279 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("contacts"); __PACKAGE__->add_columns( @@ -77,8 +77,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:53shN+K8QHeiBTDsv2sPvQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f7XjQj4iABikbR4EZrjL3g __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 74af8e45b..25d842e23 100644 --- a/perllib/FixMyStreet/DB/Result/ContactDefectType.pm +++ b/perllib/FixMyStreet/DB/Result/ContactDefectType.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("contact_defect_types"); __PACKAGE__->add_columns( @@ -42,8 +42,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zDbsla2LajNISa4Y4bF+Yg +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yjQ/+17jn8fW8J70fFtvgg # 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 ea8f11e4c..8406e2762 100644 --- a/perllib/FixMyStreet/DB/Result/ContactResponsePriority.pm +++ b/perllib/FixMyStreet/DB/Result/ContactResponsePriority.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("contact_response_priorities"); __PACKAGE__->add_columns( @@ -42,8 +42,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:47KmW1urSfZH3zvJkem8VQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NvXWYJu14GUXEHztl3Zp4w # 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 39d66a2bc..3139b2c84 100644 --- a/perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm +++ b/perllib/FixMyStreet/DB/Result/ContactResponseTemplate.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("contact_response_templates"); __PACKAGE__->add_columns( @@ -42,8 +42,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RmULAGRsBk57AlaEr8U8nw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PE5+8AZp77pb+tDFEwiOqg # 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 db8db0fe6..5a6039d6a 100644 --- a/perllib/FixMyStreet/DB/Result/ContactsHistory.pm +++ b/perllib/FixMyStreet/DB/Result/ContactsHistory.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("contacts_history"); __PACKAGE__->add_columns( @@ -42,8 +42,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("contacts_history_id"); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2QCahRyirxGjDO+nQ1ZoJA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:es6F6L3MS8pEUDprFplnYg # 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 95110d698..baee066af 100644 --- a/perllib/FixMyStreet/DB/Result/DefectType.pm +++ b/perllib/FixMyStreet/DB/Result/DefectType.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("defect_types"); __PACKAGE__->add_columns( @@ -53,8 +53,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DKLZGVTlXeq7CXd4fOfMlA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d5Gkeysiz/1P/Ww4Xur0vA __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 a9ed29ad6..18d2a7683 100644 --- a/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm +++ b/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("moderation_original_data"); __PACKAGE__->add_columns( @@ -70,8 +70,8 @@ __PACKAGE__->belongs_to( ); -# 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 +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FLKiZELcfBcc9VwHU2MZYQ use Moo; use Text::Diff; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 03213d36c..dc45091ee 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("problem"); __PACKAGE__->add_columns( @@ -170,8 +170,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bo68n1AwhO21D0hRY9Yktw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hUXle+TtlkDkxkBrVa/u+g # Add fake relationship to stored procedure table __PACKAGE__->has_one( diff --git a/perllib/FixMyStreet/DB/Result/Questionnaire.pm b/perllib/FixMyStreet/DB/Result/Questionnaire.pm index 846514fe8..2d5445669 100644 --- a/perllib/FixMyStreet/DB/Result/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/Result/Questionnaire.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("questionnaire"); __PACKAGE__->add_columns( @@ -44,8 +44,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dmTa+1kr1wB1PMSTQo3HBw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AWRb6itjsVkG5VUDRmBTIg use Moo; use namespace::clean -except => [ 'meta' ]; diff --git a/perllib/FixMyStreet/DB/Result/ResponsePriority.pm b/perllib/FixMyStreet/DB/Result/ResponsePriority.pm index cb18a442e..a478ac7b9 100644 --- a/perllib/FixMyStreet/DB/Result/ResponsePriority.pm +++ b/perllib/FixMyStreet/DB/Result/ResponsePriority.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("response_priorities"); __PACKAGE__->add_columns( @@ -57,8 +57,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZCnlu9d3mEwzsJJPiMpUCQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gIttzSJcQ8GxTowrQZ8oAw __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 e9c129e4c..85bf80aef 100644 --- a/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm +++ b/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("response_templates"); __PACKAGE__->add_columns( @@ -58,8 +58,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2ovSQI1Mgmn1JWMEGw24mQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MzTa7p2rryKkxbRi7zN+Uw __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 17732d1c9..045375fef 100644 --- a/perllib/FixMyStreet/DB/Result/Secret.pm +++ b/perllib/FixMyStreet/DB/Result/Secret.pm @@ -11,14 +11,14 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("secret"); __PACKAGE__->add_columns("secret", { data_type => "text", is_nullable => 0 }); -# 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 +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mVU/XGxS3DVhEcHTA2srgA # 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 7461f7cd6..94f7e823c 100644 --- a/perllib/FixMyStreet/DB/Result/Session.pm +++ b/perllib/FixMyStreet/DB/Result/Session.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("sessions"); __PACKAGE__->add_columns( @@ -25,8 +25,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Pywdv4Jx/uvQX6zF0UrFBA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HoYrCwULpxJVJ1m9ASMk3A use Storable; use MIME::Base64; diff --git a/perllib/FixMyStreet/DB/Result/State.pm b/perllib/FixMyStreet/DB/Result/State.pm index f6cbd573b..66477111b 100644 --- a/perllib/FixMyStreet/DB/Result/State.pm +++ b/perllib/FixMyStreet/DB/Result/State.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("state"); __PACKAGE__->add_columns( @@ -34,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 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vG7A4UVYLsXLnhMZ0roV5Q +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f/QeR3FYL/4wIGRu3c/C/A use Moo; use namespace::clean; diff --git a/perllib/FixMyStreet/DB/Result/Token.pm b/perllib/FixMyStreet/DB/Result/Token.pm index 3e6573d8e..444d5e5a8 100644 --- a/perllib/FixMyStreet/DB/Result/Token.pm +++ b/perllib/FixMyStreet/DB/Result/Token.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("token"); __PACKAGE__->add_columns( @@ -32,8 +32,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("scope", "token"); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:b+YjiisJdWRbCRrLNuMGiw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:km/1K3PurX8bbgnYPWgLIA use mySociety::AuthToken; diff --git a/perllib/FixMyStreet/DB/Result/Translation.pm b/perllib/FixMyStreet/DB/Result/Translation.pm index e30604bc0..4d6373d40 100644 --- a/perllib/FixMyStreet/DB/Result/Translation.pm +++ b/perllib/FixMyStreet/DB/Result/Translation.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("translation"); __PACKAGE__->add_columns( @@ -40,8 +40,8 @@ __PACKAGE__->add_unique_constraint( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TaUNrkZDLs7Tbf8PgGyPSQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EsseG51ZpQa5QYHPCpkL8A # 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 5908f0b42..d01ba92d0 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("users"); __PACKAGE__->add_columns( @@ -123,8 +123,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5AiItinC1TPwJyxQDa7rsg +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BCCqv3JCec8psuRk/SdCJQ # 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 a228a41bb..8fdabbdda 100644 --- a/perllib/FixMyStreet/DB/Result/UserBodyPermission.pm +++ b/perllib/FixMyStreet/DB/Result/UserBodyPermission.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("user_body_permissions"); __PACKAGE__->add_columns( @@ -48,8 +48,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Itry3jr8zO46KNklQdb7vA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mcgnPaCmEuLWdzB3GuQiTg # 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 9323e03ef..cd1716f02 100644 --- a/perllib/FixMyStreet/DB/Result/UserPlannedReport.pm +++ b/perllib/FixMyStreet/DB/Result/UserPlannedReport.pm @@ -11,7 +11,7 @@ use base 'DBIx::Class::Core'; __PACKAGE__->load_components( "FilterColumn", "FixMyStreet::InflateColumn::DateTime", - "EncodedColumn", + "FixMyStreet::EncodedColumn", ); __PACKAGE__->table("user_planned_reports"); __PACKAGE__->add_columns( @@ -51,8 +51,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:03:14 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JpeR3k8BTlNAhnhrBeQWAQ +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2019-04-25 12:06:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A9ICDFNVzkmd/erdtYdeVA # You can replace this text with custom code or comments, and it will be preserved on regeneration |