From 59e04730519f100b64d38c71ef8d59fe74a2b92b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 26 Mar 2021 14:52:07 -0300 Subject: [PATCH] Bug 14957: DBIC changes Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- Koha/Schema/Result/MarcMergeRule.pm | 110 -------------- Koha/Schema/Result/MarcOverlayRule.pm | 142 +++++++++++++++++++ Koha/Schema/Result/MarcOverlayRulesModule.pm | 103 ++++++++++++++ 3 files changed, 245 insertions(+), 110 deletions(-) delete mode 100644 Koha/Schema/Result/MarcMergeRule.pm create mode 100644 Koha/Schema/Result/MarcOverlayRule.pm create mode 100644 Koha/Schema/Result/MarcOverlayRulesModule.pm diff --git a/Koha/Schema/Result/MarcMergeRule.pm b/Koha/Schema/Result/MarcMergeRule.pm deleted file mode 100644 index 104b7f54c0..0000000000 --- a/Koha/Schema/Result/MarcMergeRule.pm +++ /dev/null @@ -1,110 +0,0 @@ -use utf8; -package Koha::Schema::Result::MarcMergeRule; - -# Created by DBIx::Class::Schema::Loader -# DO NOT MODIFY THE FIRST PART OF THIS FILE - -=head1 NAME - -Koha::Schema::Result::MarcMergeRule - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -=head1 TABLE: C - -=cut - -__PACKAGE__->table("marc_merge_rules"); - -=head1 ACCESSORS - -=head2 id - - data_type: 'integer' - is_auto_increment: 1 - is_nullable: 0 - -=head2 tag - - data_type: 'varchar' - is_nullable: 0 - size: 255 - -=head2 module - - data_type: 'varchar' - is_nullable: 0 - size: 127 - -=head2 filter - - data_type: 'varchar' - is_nullable: 0 - size: 255 - -=head2 add - - data_type: 'tinyint' - is_nullable: 0 - -=head2 append - - data_type: 'tinyint' - is_nullable: 0 - -=head2 remove - - data_type: 'tinyint' - is_nullable: 0 - -=head2 delete - - accessor: undef - data_type: 'tinyint' - is_nullable: 0 - -=cut - -__PACKAGE__->add_columns( - "id", - { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, - "tag", - { data_type => "varchar", is_nullable => 0, size => 255 }, - "module", - { data_type => "varchar", is_nullable => 0, size => 127 }, - "filter", - { data_type => "varchar", is_nullable => 0, size => 255 }, - "add", - { data_type => "tinyint", is_nullable => 0 }, - "append", - { data_type => "tinyint", is_nullable => 0 }, - "remove", - { data_type => "tinyint", is_nullable => 0 }, - "delete", - { accessor => undef, data_type => "tinyint", is_nullable => 0 }, -); - -=head1 PRIMARY KEY - -=over 4 - -=item * L - -=back - -=cut - -__PACKAGE__->set_primary_key("id"); - - -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-02-10 16:31:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jdTzjEX0dUsXzK7LtlOS9w - - -# You can replace this text with custom code or comments, and it will be preserved on regeneration -1; diff --git a/Koha/Schema/Result/MarcOverlayRule.pm b/Koha/Schema/Result/MarcOverlayRule.pm new file mode 100644 index 0000000000..e0a882715a --- /dev/null +++ b/Koha/Schema/Result/MarcOverlayRule.pm @@ -0,0 +1,142 @@ +use utf8; +package Koha::Schema::Result::MarcOverlayRule; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::MarcOverlayRule + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("marc_overlay_rules"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 tag + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 module + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 0 + size: 127 + +=head2 filter + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 add + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 append + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 remove + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 delete + + accessor: undef + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "tag", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "module", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 127 }, + "filter", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "add", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "append", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "remove", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "delete", + { + accessor => undef, + data_type => "tinyint", + default_value => 0, + is_nullable => 0, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 module + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "module", + "Koha::Schema::Result::MarcOverlayRulesModule", + { name => "module" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-03-26 17:56:31 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zSQHbrkBihPcEkzjW1M2bg + +__PACKAGE__->add_columns( + '+add' => { is_boolean => 1 }, + '+append' => { is_boolean => 1 }, + '+remove' => { is_boolean => 1 }, + '+delete' => { is_boolean => 1 } +); + +1; diff --git a/Koha/Schema/Result/MarcOverlayRulesModule.pm b/Koha/Schema/Result/MarcOverlayRulesModule.pm new file mode 100644 index 0000000000..a3c8f58c16 --- /dev/null +++ b/Koha/Schema/Result/MarcOverlayRulesModule.pm @@ -0,0 +1,103 @@ +use utf8; +package Koha::Schema::Result::MarcOverlayRulesModule; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::MarcOverlayRulesModule + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("marc_overlay_rules_modules"); + +=head1 ACCESSORS + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 127 + +=head2 description + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 specificity + + data_type: 'integer' + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "name", + { data_type => "varchar", is_nullable => 0, size => 127 }, + "description", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "specificity", + { data_type => "integer", is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("name"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("specificity", ["specificity"]); + +=head1 RELATIONS + +=head2 marc_overlay_rules + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "marc_overlay_rules", + "Koha::Schema::Result::MarcOverlayRule", + { "foreign.module" => "self.name" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-03-26 17:50:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NcP7xFRa7qXyck6wIQg/YQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.39.5