@@ -, +, @@ --- Koha/Schema/Result/Borrower.pm | 15 +++++ Koha/Schema/Result/ImportSource.pm | 89 ++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 Koha/Schema/Result/ImportSource.pm --- a/Koha/Schema/Result/Borrower.pm +++ a/Koha/Schema/Result/Borrower.pm @@ -1432,6 +1432,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 import_sources + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "import_sources", + "Koha::Schema::Result::ImportSource", + { "foreign.patron_id" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 issues Type: has_many --- a/Koha/Schema/Result/ImportSource.pm +++ a/Koha/Schema/Result/ImportSource.pm @@ -0,0 +1,89 @@ +use utf8; +package Koha::Schema::Result::ImportSource; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ImportSource + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("import_source"); + +=head1 ACCESSORS + +=head2 import_source_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 name + + data_type: 'text' + is_nullable: 0 + +=head2 patron_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "import_source_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "text", is_nullable => 0 }, + "patron_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("import_source_id"); + +=head1 RELATIONS + +=head2 patron + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "patron", + "Koha::Schema::Result::Borrower", + { borrowernumber => "patron_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-02-02 19:57:13 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oz4padFuRhd33AKaO5hRRQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; --