From d391d1a422441107ba19a8b3b39ed48e2c0975b1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Jun 2022 10:10:23 +0200 Subject: [PATCH] Bug 32030: DBIC Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Aqbookseller.pm | 74 ++++- Koha/Schema/Result/Biblio.pm | 19 +- Koha/Schema/Result/Borrower.pm | 19 +- Koha/Schema/Result/ErmAgreement.pm | 265 +++++++++++++++ Koha/Schema/Result/ErmAgreementLicense.pm | 166 ++++++++++ Koha/Schema/Result/ErmAgreementPeriod.pm | 125 +++++++ .../Schema/Result/ErmAgreementRelationship.pm | 138 ++++++++ Koha/Schema/Result/ErmDocument.pm | 203 ++++++++++++ Koha/Schema/Result/ErmEholdingsPackage.pm | 196 +++++++++++ .../Result/ErmEholdingsPackagesAgreement.pm | 108 +++++++ Koha/Schema/Result/ErmEholdingsResource.pm | 175 ++++++++++ Koha/Schema/Result/ErmEholdingsTitle.pm | 304 ++++++++++++++++++ Koha/Schema/Result/ErmLicense.pm | 195 +++++++++++ Koha/Schema/Result/ErmUserRole.pm | 134 ++++++++ 14 files changed, 2115 insertions(+), 6 deletions(-) create mode 100644 Koha/Schema/Result/ErmAgreement.pm create mode 100644 Koha/Schema/Result/ErmAgreementLicense.pm create mode 100644 Koha/Schema/Result/ErmAgreementPeriod.pm create mode 100644 Koha/Schema/Result/ErmAgreementRelationship.pm create mode 100644 Koha/Schema/Result/ErmDocument.pm create mode 100644 Koha/Schema/Result/ErmEholdingsPackage.pm create mode 100644 Koha/Schema/Result/ErmEholdingsPackagesAgreement.pm create mode 100644 Koha/Schema/Result/ErmEholdingsResource.pm create mode 100644 Koha/Schema/Result/ErmEholdingsTitle.pm create mode 100644 Koha/Schema/Result/ErmLicense.pm create mode 100644 Koha/Schema/Result/ErmUserRole.pm diff --git a/Koha/Schema/Result/Aqbookseller.pm b/Koha/Schema/Result/Aqbookseller.pm index 40b7c04bb5..d277785eb4 100644 --- a/Koha/Schema/Result/Aqbookseller.pm +++ b/Koha/Schema/Result/Aqbookseller.pm @@ -186,6 +186,14 @@ vendor fax number vendor delivery time +=head2 external_id + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +external id of the vendor + =cut __PACKAGE__->add_columns( @@ -233,6 +241,8 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 50 }, "deliverytime", { data_type => "integer", is_nullable => 1 }, + "external_id", + { data_type => "varchar", is_nullable => 1, size => 255 }, ); =head1 PRIMARY KEY @@ -339,6 +349,66 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 erm_agreements + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_agreements", + "Koha::Schema::Result::ErmAgreement", + { "foreign.vendor_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_eholdings_packages + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_eholdings_packages", + "Koha::Schema::Result::ErmEholdingsPackage", + { "foreign.vendor_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_eholdings_resources + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_eholdings_resources", + "Koha::Schema::Result::ErmEholdingsResource", + { "foreign.vendor_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_licenses + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_licenses", + "Koha::Schema::Result::ErmLicense", + { "foreign.vendor_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 invoiceprice Type: belongs_to @@ -395,8 +465,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-08-19 19:19:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EsIKCiL9L92WHNrL78MVaA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-19 09:20:21 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Xxg454HATZToWE01NY8eJw __PACKAGE__->add_columns( '+active' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm index f27ee62b08..2d9abfb7e0 100644 --- a/Koha/Schema/Result/Biblio.pm +++ b/Koha/Schema/Result/Biblio.pm @@ -300,6 +300,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 erm_eholdings_titles + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_eholdings_titles", + "Koha::Schema::Result::ErmEholdingsTitle", + { "foreign.biblio_id" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 hold_fill_targets Type: has_many @@ -556,8 +571,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-08 19:06:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QmW8BVyUx2F2MAp6ZG45mg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-13 12:25:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:C1RZYgDcw6WrZ5laTaKV6w __PACKAGE__->has_many( "biblioitem", diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 2edb25d29f..60684eebd8 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1312,6 +1312,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 erm_user_roles + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_user_roles", + "Koha::Schema::Result::ErmUserRole", + { "foreign.user_id" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 hold_fill_targets Type: has_many @@ -2028,8 +2043,8 @@ Composing rels: L -> permission __PACKAGE__->many_to_many("permissions", "user_permissions", "permission"); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-03 18:03:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jqvQns/EYDe6ao4z32XKyg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-01 07:44:13 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aezs6MyXhwra3gEHhXjAmg __PACKAGE__->has_many( "extended_attributes", diff --git a/Koha/Schema/Result/ErmAgreement.pm b/Koha/Schema/Result/ErmAgreement.pm new file mode 100644 index 0000000000..c7b9bf471f --- /dev/null +++ b/Koha/Schema/Result/ErmAgreement.pm @@ -0,0 +1,265 @@ +use utf8; +package Koha::Schema::Result::ErmAgreement; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmAgreement + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_agreements"); + +=head1 ACCESSORS + +=head2 agreement_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +primary key + +=head2 vendor_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +foreign key to aqbooksellers + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +name of the agreement + +=head2 description + + data_type: 'longtext' + is_nullable: 1 + +description of the agreement + +=head2 status + + data_type: 'varchar' + is_nullable: 0 + size: 80 + +current status of the agreement + +=head2 closure_reason + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +reason of the closure + +=head2 is_perpetual + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +is the agreement perpetual + +=head2 renewal_priority + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +priority of the renewal + +=head2 license_info + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +info about the license + +=cut + +__PACKAGE__->add_columns( + "agreement_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "vendor_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "description", + { data_type => "longtext", is_nullable => 1 }, + "status", + { data_type => "varchar", is_nullable => 0, size => 80 }, + "closure_reason", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "is_perpetual", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "renewal_priority", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "license_info", + { data_type => "varchar", is_nullable => 1, size => 80 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("agreement_id"); + +=head1 RELATIONS + +=head2 erm_agreement_licenses + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_agreement_licenses", + "Koha::Schema::Result::ErmAgreementLicense", + { "foreign.agreement_id" => "self.agreement_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_agreement_periods + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_agreement_periods", + "Koha::Schema::Result::ErmAgreementPeriod", + { "foreign.agreement_id" => "self.agreement_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_agreement_relationships_agreements + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_agreement_relationships_agreements", + "Koha::Schema::Result::ErmAgreementRelationship", + { "foreign.agreement_id" => "self.agreement_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_agreement_relationships_related_agreements + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_agreement_relationships_related_agreements", + "Koha::Schema::Result::ErmAgreementRelationship", + { "foreign.related_agreement_id" => "self.agreement_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_documents + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_documents", + "Koha::Schema::Result::ErmDocument", + { "foreign.agreement_id" => "self.agreement_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_eholdings_packages_agreements + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_eholdings_packages_agreements", + "Koha::Schema::Result::ErmEholdingsPackagesAgreement", + { "foreign.agreement_id" => "self.agreement_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_user_roles + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_user_roles", + "Koha::Schema::Result::ErmUserRole", + { "foreign.agreement_id" => "self.agreement_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 vendor + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "vendor", + "Koha::Schema::Result::Aqbookseller", + { id => "vendor_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-01 07:44:13 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rdLbabpHCgb4l88Gmgst+g + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmAgreementLicense.pm b/Koha/Schema/Result/ErmAgreementLicense.pm new file mode 100644 index 0000000000..79025b7c66 --- /dev/null +++ b/Koha/Schema/Result/ErmAgreementLicense.pm @@ -0,0 +1,166 @@ +use utf8; +package Koha::Schema::Result::ErmAgreementLicense; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmAgreementLicense + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_agreement_licenses"); + +=head1 ACCESSORS + +=head2 agreement_license_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +primary key + +=head2 agreement_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +link to the agreement + +=head2 license_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +link to the license + +=head2 status + + data_type: 'varchar' + is_nullable: 0 + size: 80 + +current status of the license + +=head2 physical_location + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +physical location of the license + +=head2 notes + + data_type: 'mediumtext' + is_nullable: 1 + +notes about this license + +=head2 uri + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +URI of the license + +=cut + +__PACKAGE__->add_columns( + "agreement_license_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "agreement_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "license_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "status", + { data_type => "varchar", is_nullable => 0, size => 80 }, + "physical_location", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "notes", + { data_type => "mediumtext", is_nullable => 1 }, + "uri", + { data_type => "varchar", is_nullable => 1, size => 255 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("agreement_license_id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("erm_agreement_licenses_uniq", ["agreement_id", "license_id"]); + +=head1 RELATIONS + +=head2 agreement + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "agreement", + "Koha::Schema::Result::ErmAgreement", + { agreement_id => "agreement_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 license + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "license", + "Koha::Schema::Result::ErmLicense", + { license_id => "license_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-20 08:58:20 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pO0QPWFMSap1XER+0hdEqg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmAgreementPeriod.pm b/Koha/Schema/Result/ErmAgreementPeriod.pm new file mode 100644 index 0000000000..00b128a147 --- /dev/null +++ b/Koha/Schema/Result/ErmAgreementPeriod.pm @@ -0,0 +1,125 @@ +use utf8; +package Koha::Schema::Result::ErmAgreementPeriod; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmAgreementPeriod + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_agreement_periods"); + +=head1 ACCESSORS + +=head2 agreement_period_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +primary key + +=head2 agreement_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +link to the agreement + +=head2 started_on + + data_type: 'date' + datetime_undef_if_invalid: 1 + is_nullable: 0 + +start of the agreement period + +=head2 ended_on + + data_type: 'date' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +end of the agreement period + +=head2 cancellation_deadline + + data_type: 'date' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +Deadline for the cancellation + +=head2 notes + + data_type: 'mediumtext' + is_nullable: 1 + +notes about this period + +=cut + +__PACKAGE__->add_columns( + "agreement_period_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "agreement_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "started_on", + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 }, + "ended_on", + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + "cancellation_deadline", + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + "notes", + { data_type => "mediumtext", is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("agreement_period_id"); + +=head1 RELATIONS + +=head2 agreement + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "agreement", + "Koha::Schema::Result::ErmAgreement", + { agreement_id => "agreement_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-25 11:46:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NCQpSw+rp/9B/yOrtLtK6g + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmAgreementRelationship.pm b/Koha/Schema/Result/ErmAgreementRelationship.pm new file mode 100644 index 0000000000..43e17979d8 --- /dev/null +++ b/Koha/Schema/Result/ErmAgreementRelationship.pm @@ -0,0 +1,138 @@ +use utf8; +package Koha::Schema::Result::ErmAgreementRelationship; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmAgreementRelationship + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_agreement_relationships"); + +=head1 ACCESSORS + +=head2 agreement_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +link to the agreement + +=head2 related_agreement_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +link to the related agreement + +=head2 relationship + + data_type: 'enum' + extra: {list => ["supersedes","is-superseded-by","provides_post-cancellation_access_for","has-post-cancellation-access-in","tracks_demand-driven_acquisitions_for","has-demand-driven-acquisitions-in","has_backfile_in","has_frontfile_in","related_to"]} + is_nullable: 0 + +relationship between the two agreements + +=head2 notes + + data_type: 'mediumtext' + is_nullable: 1 + +notes about this relationship + +=cut + +__PACKAGE__->add_columns( + "agreement_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "related_agreement_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "relationship", + { + data_type => "enum", + extra => { + list => [ + "supersedes", + "is-superseded-by", + "provides_post-cancellation_access_for", + "has-post-cancellation-access-in", + "tracks_demand-driven_acquisitions_for", + "has-demand-driven-acquisitions-in", + "has_backfile_in", + "has_frontfile_in", + "related_to", + ], + }, + is_nullable => 0, + }, + "notes", + { data_type => "mediumtext", is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("agreement_id", "related_agreement_id"); + +=head1 RELATIONS + +=head2 agreement + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "agreement", + "Koha::Schema::Result::ErmAgreement", + { agreement_id => "agreement_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 related_agreement + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "related_agreement", + "Koha::Schema::Result::ErmAgreement", + { agreement_id => "related_agreement_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-25 11:46:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EYK21+2xV7p1yCXR8OFKIA + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmDocument.pm b/Koha/Schema/Result/ErmDocument.pm new file mode 100644 index 0000000000..c0bc028de6 --- /dev/null +++ b/Koha/Schema/Result/ErmDocument.pm @@ -0,0 +1,203 @@ +use utf8; +package Koha::Schema::Result::ErmDocument; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmDocument + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_documents"); + +=head1 ACCESSORS + +=head2 document_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +primary key + +=head2 agreement_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +link to the agreement + +=head2 license_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +link to the license + +=head2 file_name + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +name of the file + +=head2 file_type + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +type of the file + +=head2 file_description + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +description of the file + +=head2 file_content + + data_type: 'longblob' + is_nullable: 1 + +the content of the file + +=head2 uploaded_on + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +datetime when the file as attached + +=head2 physical_location + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +physical location of the document + +=head2 uri + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +URI of the document + +=head2 notes + + data_type: 'mediumtext' + is_nullable: 1 + +notes about this relationship + +=cut + +__PACKAGE__->add_columns( + "document_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "agreement_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "license_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "file_name", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "file_type", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "file_description", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "file_content", + { data_type => "longblob", is_nullable => 1 }, + "uploaded_on", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "physical_location", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "uri", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "notes", + { data_type => "mediumtext", is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("document_id"); + +=head1 RELATIONS + +=head2 agreement + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "agreement", + "Koha::Schema::Result::ErmAgreement", + { agreement_id => "agreement_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + +=head2 license + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "license", + "Koha::Schema::Result::ErmLicense", + { license_id => "license_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-21 09:22:27 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rbU2G4zjKlEcOtuwVBSXaw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmEholdingsPackage.pm b/Koha/Schema/Result/ErmEholdingsPackage.pm new file mode 100644 index 0000000000..611547a941 --- /dev/null +++ b/Koha/Schema/Result/ErmEholdingsPackage.pm @@ -0,0 +1,196 @@ +use utf8; +package Koha::Schema::Result::ErmEholdingsPackage; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmEholdingsPackage + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_eholdings_packages"); + +=head1 ACCESSORS + +=head2 package_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +primary key + +=head2 vendor_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +foreign key to aqbooksellers + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +name of the package + +=head2 external_id + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +External key + +=head2 provider + + data_type: 'enum' + extra: {list => ["ebsco"]} + is_nullable: 1 + +External provider + +=head2 package_type + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +type of the package + +=head2 content_type + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +type of the package + +=head2 notes + + data_type: 'mediumtext' + is_nullable: 1 + +notes about this package + +=head2 created_on + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + default_value: current_timestamp + is_nullable: 0 + +date of creation of the package + +=cut + +__PACKAGE__->add_columns( + "package_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "vendor_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "external_id", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "provider", + { data_type => "enum", extra => { list => ["ebsco"] }, is_nullable => 1 }, + "package_type", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "content_type", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "notes", + { data_type => "mediumtext", is_nullable => 1 }, + "created_on", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("package_id"); + +=head1 RELATIONS + +=head2 erm_eholdings_packages_agreements + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_eholdings_packages_agreements", + "Koha::Schema::Result::ErmEholdingsPackagesAgreement", + { "foreign.package_id" => "self.package_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_eholdings_resources + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_eholdings_resources", + "Koha::Schema::Result::ErmEholdingsResource", + { "foreign.package_id" => "self.package_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 vendor + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "vendor", + "Koha::Schema::Result::Aqbookseller", + { id => "vendor_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-19 09:25:48 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KbZxONSm/pxXvUFi3PuZiQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmEholdingsPackagesAgreement.pm b/Koha/Schema/Result/ErmEholdingsPackagesAgreement.pm new file mode 100644 index 0000000000..f739d3b402 --- /dev/null +++ b/Koha/Schema/Result/ErmEholdingsPackagesAgreement.pm @@ -0,0 +1,108 @@ +use utf8; +package Koha::Schema::Result::ErmEholdingsPackagesAgreement; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmEholdingsPackagesAgreement + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_eholdings_packages_agreements"); + +=head1 ACCESSORS + +=head2 package_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +link to the package + +=head2 agreement_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +link to the agreement + +=cut + +__PACKAGE__->add_columns( + "package_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "agreement_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, +); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint( + "erm_eholdings_packages_agreements_uniq", + ["package_id", "agreement_id"], +); + +=head1 RELATIONS + +=head2 agreement + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "agreement", + "Koha::Schema::Result::ErmAgreement", + { agreement_id => "agreement_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 package + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "package", + "Koha::Schema::Result::ErmEholdingsPackage", + { package_id => "package_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-20 08:58:20 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OfIIIupuz76wN2HDac5fng + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmEholdingsResource.pm b/Koha/Schema/Result/ErmEholdingsResource.pm new file mode 100644 index 0000000000..f81316636a --- /dev/null +++ b/Koha/Schema/Result/ErmEholdingsResource.pm @@ -0,0 +1,175 @@ +use utf8; +package Koha::Schema::Result::ErmEholdingsResource; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmEholdingsResource + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_eholdings_resources"); + +=head1 ACCESSORS + +=head2 resource_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +primary key + +=head2 title_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 package_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 vendor_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 started_on + + data_type: 'date' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 ended_on + + data_type: 'date' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 proxy + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=cut + +__PACKAGE__->add_columns( + "resource_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "title_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "package_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "vendor_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "started_on", + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + "ended_on", + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + "proxy", + { data_type => "varchar", is_nullable => 1, size => 80 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("resource_id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("erm_eholdings_resources_uniq", ["title_id", "package_id"]); + +=head1 RELATIONS + +=head2 package + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "package", + "Koha::Schema::Result::ErmEholdingsPackage", + { package_id => "package_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 title + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "title", + "Koha::Schema::Result::ErmEholdingsTitle", + { title_id => "title_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 vendor + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "vendor", + "Koha::Schema::Result::Aqbookseller", + { id => "vendor_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-20 08:58:20 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FQbMPJvUGn+kxlA+C4JvYg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmEholdingsTitle.pm b/Koha/Schema/Result/ErmEholdingsTitle.pm new file mode 100644 index 0000000000..afe1107651 --- /dev/null +++ b/Koha/Schema/Result/ErmEholdingsTitle.pm @@ -0,0 +1,304 @@ +use utf8; +package Koha::Schema::Result::ErmEholdingsTitle; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmEholdingsTitle + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_eholdings_titles"); + +=head1 ACCESSORS + +=head2 title_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +primary key + +=head2 biblio_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 publication_title + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 external_id + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 print_identifier + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 online_identifier + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 date_first_issue_online + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 num_first_vol_online + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 num_first_issue_online + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 date_last_issue_online + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 num_last_vol_online + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 num_last_issue_online + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 title_url + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 first_author + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 embargo_info + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 coverage_depth + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 notes + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 publisher_name + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 publication_type + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 date_monograph_published_print + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 date_monograph_published_online + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 monograph_volume + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 monograph_edition + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 first_editor + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 parent_publication_title_id + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 preceeding_publication_title_id + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 access_type + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=cut + +__PACKAGE__->add_columns( + "title_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "biblio_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "publication_title", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "external_id", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "print_identifier", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "online_identifier", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "date_first_issue_online", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "num_first_vol_online", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "num_first_issue_online", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "date_last_issue_online", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "num_last_vol_online", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "num_last_issue_online", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "title_url", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "first_author", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "embargo_info", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "coverage_depth", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "notes", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "publisher_name", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "publication_type", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "date_monograph_published_print", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "date_monograph_published_online", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "monograph_volume", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "monograph_edition", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "first_editor", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "parent_publication_title_id", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "preceeding_publication_title_id", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "access_type", + { data_type => "varchar", is_nullable => 1, size => 255 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("title_id"); + +=head1 RELATIONS + +=head2 biblio + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "biblio", + "Koha::Schema::Result::Biblio", + { biblionumber => "biblio_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + +=head2 erm_eholdings_resources + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_eholdings_resources", + "Koha::Schema::Result::ErmEholdingsResource", + { "foreign.title_id" => "self.title_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-22 11:41:06 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+DZRDExmVLe+MBtk+TEhJw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmLicense.pm b/Koha/Schema/Result/ErmLicense.pm new file mode 100644 index 0000000000..7f375348cf --- /dev/null +++ b/Koha/Schema/Result/ErmLicense.pm @@ -0,0 +1,195 @@ +use utf8; +package Koha::Schema::Result::ErmLicense; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmLicense + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_licenses"); + +=head1 ACCESSORS + +=head2 license_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +primary key + +=head2 vendor_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +foreign key to aqbooksellers + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +name of the license + +=head2 description + + data_type: 'longtext' + is_nullable: 1 + +description of the license + +=head2 type + + data_type: 'varchar' + is_nullable: 0 + size: 80 + +type of the license + +=head2 status + + data_type: 'varchar' + is_nullable: 0 + size: 80 + +current status of the license + +=head2 started_on + + data_type: 'date' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +start of the license + +=head2 ended_on + + data_type: 'date' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +end of the license + +=cut + +__PACKAGE__->add_columns( + "license_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "vendor_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "description", + { data_type => "longtext", is_nullable => 1 }, + "type", + { data_type => "varchar", is_nullable => 0, size => 80 }, + "status", + { data_type => "varchar", is_nullable => 0, size => 80 }, + "started_on", + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + "ended_on", + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("license_id"); + +=head1 RELATIONS + +=head2 erm_agreement_licenses + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_agreement_licenses", + "Koha::Schema::Result::ErmAgreementLicense", + { "foreign.license_id" => "self.license_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_documents + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_documents", + "Koha::Schema::Result::ErmDocument", + { "foreign.license_id" => "self.license_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 erm_user_roles + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "erm_user_roles", + "Koha::Schema::Result::ErmUserRole", + { "foreign.license_id" => "self.license_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 vendor + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "vendor", + "Koha::Schema::Result::Aqbookseller", + { id => "vendor_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-01 07:44:13 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Fs4bmI/N6Cvicv3RW2qwXQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ErmUserRole.pm b/Koha/Schema/Result/ErmUserRole.pm new file mode 100644 index 0000000000..07e5094433 --- /dev/null +++ b/Koha/Schema/Result/ErmUserRole.pm @@ -0,0 +1,134 @@ +use utf8; +package Koha::Schema::Result::ErmUserRole; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ErmUserRole + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("erm_user_roles"); + +=head1 ACCESSORS + +=head2 agreement_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +link to the agreement + +=head2 license_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +link to the license + +=head2 user_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +link to the user + +=head2 role + + data_type: 'varchar' + is_nullable: 0 + size: 80 + +role of the user + +=cut + +__PACKAGE__->add_columns( + "agreement_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "license_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "user_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "role", + { data_type => "varchar", is_nullable => 0, size => 80 }, +); + +=head1 RELATIONS + +=head2 agreement + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "agreement", + "Koha::Schema::Result::ErmAgreement", + { agreement_id => "agreement_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + +=head2 license + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "license", + "Koha::Schema::Result::ErmLicense", + { license_id => "license_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + +=head2 user + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "user", + "Koha::Schema::Result::Borrower", + { borrowernumber => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-01 07:44:13 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RkK5cQWFEmcrDioAfjOVWQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.39.5