From f1865d9cd750e22e8a4e494f01d1eeb80ad8b67f Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 4 Jun 2018 14:18:15 +0200 Subject: [PATCH] Bug 20819: DBIx schema changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No test plan. Signed-off-by: Séverine QUEUNE Signed-off-by: Josef Moravec --- Koha/Schema/Result/Borrower.pm | 15 ++++ Koha/Schema/Result/BorrowerModification.pm | 16 +++- Koha/Schema/Result/PatronConsent.pm | 118 +++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 Koha/Schema/Result/PatronConsent.pm diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index ab0fefc..3b08198 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1145,6 +1145,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 patron_consents + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "patron_consents", + "Koha::Schema::Result::PatronConsent", + { "foreign.borrowernumber" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 patron_list_patrons Type: has_many diff --git a/Koha/Schema/Result/BorrowerModification.pm b/Koha/Schema/Result/BorrowerModification.pm index 013da77..8e3cecb 100644 --- a/Koha/Schema/Result/BorrowerModification.pm +++ b/Koha/Schema/Result/BorrowerModification.pm @@ -415,6 +415,12 @@ __PACKAGE__->table("borrower_modifications"); data_type: 'mediumtext' is_nullable: 1 +=head2 gdpr_proc_consent + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -581,6 +587,12 @@ __PACKAGE__->add_columns( { data_type => "integer", is_nullable => 1 }, "extended_attributes", { data_type => "mediumtext", is_nullable => 1 }, + "gdpr_proc_consent", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, ); =head1 PRIMARY KEY @@ -598,8 +610,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("verification_token", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Vv0bJqR71Ust1MZAkYqTig +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-06-04 14:17:47 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NE/d8+g2NbRoj/VCd2ecyg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/PatronConsent.pm b/Koha/Schema/Result/PatronConsent.pm new file mode 100644 index 0000000..fc4c8c1 --- /dev/null +++ b/Koha/Schema/Result/PatronConsent.pm @@ -0,0 +1,118 @@ +use utf8; +package Koha::Schema::Result::PatronConsent; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::PatronConsent + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("patron_consent"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 borrowernumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 type + + data_type: 'enum' + extra: {list => ["GDPR_PROCESSING"]} + is_nullable: 1 + +=head2 given_on + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 refused_on + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "borrowernumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "type", + { + data_type => "enum", + extra => { list => ["GDPR_PROCESSING"] }, + is_nullable => 1, + }, + "given_on", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "refused_on", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 borrowernumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "borrowernumber", + "Koha::Schema::Result::Borrower", + { borrowernumber => "borrowernumber" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-06-04 14:17:47 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rCOHwL/2vlzKAUM517J+HA + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.1.4