From 7ad9e8a42684cd6602652aa53d75c0e3a221ff19 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 31 Oct 2013 22:04:22 +0000 Subject: [PATCH] Bug 8015: (follow-up) update DBIx::Class schema classes Signed-off-by: Galen Charlton --- .../Schema/Result/MarcModificationTemplate.pm | 81 ++++++ .../Result/MarcModificationTemplateAction.pm | 236 ++++++++++++++++++ 2 files changed, 317 insertions(+) create mode 100644 Koha/Schema/Result/MarcModificationTemplate.pm create mode 100644 Koha/Schema/Result/MarcModificationTemplateAction.pm diff --git a/Koha/Schema/Result/MarcModificationTemplate.pm b/Koha/Schema/Result/MarcModificationTemplate.pm new file mode 100644 index 0000000000..7590f19999 --- /dev/null +++ b/Koha/Schema/Result/MarcModificationTemplate.pm @@ -0,0 +1,81 @@ +use utf8; +package Koha::Schema::Result::MarcModificationTemplate; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::MarcModificationTemplate + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("marc_modification_templates"); + +=head1 ACCESSORS + +=head2 template_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 name + + data_type: 'text' + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "template_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "text", is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("template_id"); + +=head1 RELATIONS + +=head2 marc_modification_template_actions + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "marc_modification_template_actions", + "Koha::Schema::Result::MarcModificationTemplateAction", + { "foreign.template_id" => "self.template_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-31 22:03:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:igqidvfP0AgV5RRBa1huew + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/MarcModificationTemplateAction.pm b/Koha/Schema/Result/MarcModificationTemplateAction.pm new file mode 100644 index 0000000000..d6771e1433 --- /dev/null +++ b/Koha/Schema/Result/MarcModificationTemplateAction.pm @@ -0,0 +1,236 @@ +use utf8; +package Koha::Schema::Result::MarcModificationTemplateAction; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::MarcModificationTemplateAction + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("marc_modification_template_actions"); + +=head1 ACCESSORS + +=head2 mmta_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 template_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 ordering + + data_type: 'integer' + is_nullable: 0 + +=head2 action + + data_type: 'enum' + extra: {list => ["delete_field","update_field","move_field","copy_field"]} + is_nullable: 0 + +=head2 field_number + + data_type: 'smallint' + default_value: 0 + is_nullable: 0 + +=head2 from_field + + data_type: 'varchar' + is_nullable: 0 + size: 3 + +=head2 from_subfield + + data_type: 'varchar' + is_nullable: 1 + size: 1 + +=head2 field_value + + data_type: 'varchar' + is_nullable: 1 + size: 100 + +=head2 to_field + + data_type: 'varchar' + is_nullable: 1 + size: 3 + +=head2 to_subfield + + data_type: 'varchar' + is_nullable: 1 + size: 1 + +=head2 to_regex_search + + data_type: 'text' + is_nullable: 1 + +=head2 to_regex_replace + + data_type: 'text' + is_nullable: 1 + +=head2 to_regex_modifiers + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 1 + size: 8 + +=head2 conditional + + data_type: 'enum' + extra: {list => ["if","unless"]} + is_nullable: 1 + +=head2 conditional_field + + data_type: 'varchar' + is_nullable: 1 + size: 3 + +=head2 conditional_subfield + + data_type: 'varchar' + is_nullable: 1 + size: 1 + +=head2 conditional_comparison + + data_type: 'enum' + extra: {list => ["exists","not_exists","equals","not_equals"]} + is_nullable: 1 + +=head2 conditional_value + + data_type: 'text' + is_nullable: 1 + +=head2 conditional_regex + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 description + + data_type: 'text' + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "mmta_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "template_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "ordering", + { data_type => "integer", is_nullable => 0 }, + "action", + { + data_type => "enum", + extra => { + list => ["delete_field", "update_field", "move_field", "copy_field"], + }, + is_nullable => 0, + }, + "field_number", + { data_type => "smallint", default_value => 0, is_nullable => 0 }, + "from_field", + { data_type => "varchar", is_nullable => 0, size => 3 }, + "from_subfield", + { data_type => "varchar", is_nullable => 1, size => 1 }, + "field_value", + { data_type => "varchar", is_nullable => 1, size => 100 }, + "to_field", + { data_type => "varchar", is_nullable => 1, size => 3 }, + "to_subfield", + { data_type => "varchar", is_nullable => 1, size => 1 }, + "to_regex_search", + { data_type => "text", is_nullable => 1 }, + "to_regex_replace", + { data_type => "text", is_nullable => 1 }, + "to_regex_modifiers", + { data_type => "varchar", default_value => "", is_nullable => 1, size => 8 }, + "conditional", + { + data_type => "enum", + extra => { list => ["if", "unless"] }, + is_nullable => 1, + }, + "conditional_field", + { data_type => "varchar", is_nullable => 1, size => 3 }, + "conditional_subfield", + { data_type => "varchar", is_nullable => 1, size => 1 }, + "conditional_comparison", + { + data_type => "enum", + extra => { list => ["exists", "not_exists", "equals", "not_equals"] }, + is_nullable => 1, + }, + "conditional_value", + { data_type => "text", is_nullable => 1 }, + "conditional_regex", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "description", + { data_type => "text", is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("mmta_id"); + +=head1 RELATIONS + +=head2 template + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "template", + "Koha::Schema::Result::MarcModificationTemplate", + { template_id => "template_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-31 22:03:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sl0AD0sWPYcKRjHN3l3eFg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.39.5