@@ -, +, @@ --- 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 --- a/Koha/Schema/Result/MarcMergeRule.pm +++ a/Koha/Schema/Result/MarcMergeRule.pm @@ -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; --- a/Koha/Schema/Result/MarcOverlayRule.pm +++ a/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; --- a/Koha/Schema/Result/MarcOverlayRulesModule.pm +++ a/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; --