From 83dd944325ab8041116bf6524b2142882edb89ac Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 1 Mar 2023 11:18:12 +0100 Subject: [PATCH] Bug 33103: DBIC changes --- Koha/Schema/Result/Aqbookseller.pm | 19 ++++- Koha/Schema/Result/AqbooksellerAlias.pm | 96 +++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 Koha/Schema/Result/AqbooksellerAlias.pm diff --git a/Koha/Schema/Result/Aqbookseller.pm b/Koha/Schema/Result/Aqbookseller.pm index d277785eb41..c53b93573d8 100644 --- a/Koha/Schema/Result/Aqbookseller.pm +++ b/Koha/Schema/Result/Aqbookseller.pm @@ -289,6 +289,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 aqbookseller_aliases + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "aqbookseller_aliases", + "Koha::Schema::Result::AqbooksellerAlias", + { "foreign.vendor_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 aqcontacts Type: has_many @@ -465,8 +480,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-19 09:20:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Xxg454HATZToWE01NY8eJw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-03-01 10:07:31 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YBiWEJqaEoEzap60SDok+A __PACKAGE__->add_columns( '+active' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/AqbooksellerAlias.pm b/Koha/Schema/Result/AqbooksellerAlias.pm new file mode 100644 index 00000000000..fd983336b54 --- /dev/null +++ b/Koha/Schema/Result/AqbooksellerAlias.pm @@ -0,0 +1,96 @@ +use utf8; +package Koha::Schema::Result::AqbooksellerAlias; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::AqbooksellerAlias + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("aqbookseller_aliases"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +primary key and unique identifier assigned by Koha + +=head2 vendor_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +link to the vendor + +=head2 alias + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +the alias + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "vendor_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "alias", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 vendor + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "vendor", + "Koha::Schema::Result::Aqbookseller", + { id => "vendor_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-03-01 10:07:31 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9s3K0S0BfrHLN/V3X9DB1A + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.25.1