From f939d9d92a89fbddb31ad1e12581bc7c68771bb8 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 30 Oct 2013 02:42:40 +0000 Subject: [PATCH] Bug 7688: (follow-up) update DBIx::Class schema classes Signed-off-by: Galen Charlton --- Koha/Schema/Result/Subscription.pm | 215 ++++++---------- Koha/Schema/Result/SubscriptionFrequency.pm | 116 +++++++++ .../Result/SubscriptionNumberpattern.pm | 236 ++++++++++++++++++ 3 files changed, 428 insertions(+), 139 deletions(-) create mode 100644 Koha/Schema/Result/SubscriptionFrequency.pm create mode 100644 Koha/Schema/Result/SubscriptionNumberpattern.pm diff --git a/Koha/Schema/Result/Subscription.pm b/Koha/Schema/Result/Subscription.pm index 77fde73349..91e408c8d3 100644 --- a/Koha/Schema/Result/Subscription.pm +++ b/Koha/Schema/Result/Subscription.pm @@ -86,23 +86,15 @@ __PACKAGE__->table("subscription"); =head2 periodicity - data_type: 'tinyint' - default_value: 0 - is_nullable: 1 - -=head2 dow - - data_type: 'varchar' - default_value: (empty string) + data_type: 'integer' + is_foreign_key: 1 is_nullable: 1 - size: 100 -=head2 numberingmethod +=head2 countissuesperunit - data_type: 'varchar' - default_value: (empty string) - is_nullable: 1 - size: 100 + data_type: 'integer' + default_value: 1 + is_nullable: 0 =head2 notes @@ -116,114 +108,39 @@ __PACKAGE__->table("subscription"); is_nullable: 0 size: 100 -=head2 add1 - - data_type: 'integer' - default_value: 0 - is_nullable: 1 - -=head2 every1 - - data_type: 'integer' - default_value: 0 - is_nullable: 1 - -=head2 whenmorethan1 - - data_type: 'integer' - default_value: 0 - is_nullable: 1 - -=head2 setto1 - - data_type: 'integer' - is_nullable: 1 - =head2 lastvalue1 data_type: 'integer' is_nullable: 1 -=head2 add2 - - data_type: 'integer' - default_value: 0 - is_nullable: 1 - -=head2 every2 - - data_type: 'integer' - default_value: 0 - is_nullable: 1 - -=head2 whenmorethan2 +=head2 innerloop1 data_type: 'integer' default_value: 0 is_nullable: 1 -=head2 setto2 - - data_type: 'integer' - is_nullable: 1 - =head2 lastvalue2 data_type: 'integer' is_nullable: 1 -=head2 add3 - - data_type: 'integer' - default_value: 0 - is_nullable: 1 - -=head2 every3 - - data_type: 'integer' - default_value: 0 - is_nullable: 1 - -=head2 innerloop1 - - data_type: 'integer' - default_value: 0 - is_nullable: 1 - =head2 innerloop2 data_type: 'integer' default_value: 0 is_nullable: 1 -=head2 innerloop3 +=head2 lastvalue3 data_type: 'integer' - default_value: 0 is_nullable: 1 -=head2 whenmorethan3 +=head2 innerloop3 data_type: 'integer' default_value: 0 is_nullable: 1 -=head2 setto3 - - data_type: 'integer' - is_nullable: 1 - -=head2 lastvalue3 - - data_type: 'integer' - is_nullable: 1 - -=head2 issuesatonce - - data_type: 'tinyint' - default_value: 1 - is_nullable: 0 - =head2 firstacquidate data_type: 'date' @@ -241,6 +158,12 @@ __PACKAGE__->table("subscription"); data_type: 'text' is_nullable: 1 +=head2 skip_serialseq + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + =head2 letter data_type: 'varchar' @@ -249,10 +172,16 @@ __PACKAGE__->table("subscription"); =head2 numberpattern - data_type: 'tinyint' - default_value: 0 + data_type: 'integer' + is_foreign_key: 1 is_nullable: 1 +=head2 locale + + data_type: 'varchar' + is_nullable: 1 + size: 80 + =head2 distributedto data_type: 'text' @@ -282,12 +211,6 @@ __PACKAGE__->table("subscription"); is_nullable: 0 size: 10 -=head2 hemisphere - - data_type: 'tinyint' - default_value: 0 - is_nullable: 1 - =head2 lastbranch data_type: 'varchar' @@ -360,63 +283,39 @@ __PACKAGE__->add_columns( "numberlength", { data_type => "integer", default_value => 0, is_nullable => 1 }, "periodicity", - { data_type => "tinyint", default_value => 0, is_nullable => 1 }, - "dow", - { data_type => "varchar", default_value => "", is_nullable => 1, size => 100 }, - "numberingmethod", - { data_type => "varchar", default_value => "", is_nullable => 1, size => 100 }, + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "countissuesperunit", + { data_type => "integer", default_value => 1, is_nullable => 0 }, "notes", { data_type => "mediumtext", is_nullable => 1 }, "status", { data_type => "varchar", default_value => "", is_nullable => 0, size => 100 }, - "add1", - { data_type => "integer", default_value => 0, is_nullable => 1 }, - "every1", - { data_type => "integer", default_value => 0, is_nullable => 1 }, - "whenmorethan1", - { data_type => "integer", default_value => 0, is_nullable => 1 }, - "setto1", - { data_type => "integer", is_nullable => 1 }, "lastvalue1", { data_type => "integer", is_nullable => 1 }, - "add2", - { data_type => "integer", default_value => 0, is_nullable => 1 }, - "every2", - { data_type => "integer", default_value => 0, is_nullable => 1 }, - "whenmorethan2", + "innerloop1", { data_type => "integer", default_value => 0, is_nullable => 1 }, - "setto2", - { data_type => "integer", is_nullable => 1 }, "lastvalue2", { data_type => "integer", is_nullable => 1 }, - "add3", - { data_type => "integer", default_value => 0, is_nullable => 1 }, - "every3", - { data_type => "integer", default_value => 0, is_nullable => 1 }, - "innerloop1", - { data_type => "integer", default_value => 0, is_nullable => 1 }, "innerloop2", { data_type => "integer", default_value => 0, is_nullable => 1 }, - "innerloop3", - { data_type => "integer", default_value => 0, is_nullable => 1 }, - "whenmorethan3", - { data_type => "integer", default_value => 0, is_nullable => 1 }, - "setto3", - { data_type => "integer", is_nullable => 1 }, "lastvalue3", { data_type => "integer", is_nullable => 1 }, - "issuesatonce", - { data_type => "tinyint", default_value => 1, is_nullable => 0 }, + "innerloop3", + { data_type => "integer", default_value => 0, is_nullable => 1 }, "firstacquidate", { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "manualhistory", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "irregularity", { data_type => "text", is_nullable => 1 }, + "skip_serialseq", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "letter", { data_type => "varchar", is_nullable => 1, size => 20 }, "numberpattern", - { data_type => "tinyint", default_value => 0, is_nullable => 1 }, + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "locale", + { data_type => "varchar", is_nullable => 1, size => 80 }, "distributedto", { data_type => "text", is_nullable => 1 }, "internalnotes", @@ -427,8 +326,6 @@ __PACKAGE__->add_columns( { data_type => "varchar", default_value => "", is_nullable => 1, size => 80 }, "branchcode", { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, - "hemisphere", - { data_type => "tinyint", default_value => 0, is_nullable => 1 }, "lastbranch", { data_type => "varchar", is_nullable => 1, size => 10 }, "serialsadditems", @@ -476,6 +373,46 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 numberpattern + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "numberpattern", + "Koha::Schema::Result::SubscriptionNumberpattern", + { id => "numberpattern" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + +=head2 periodicity + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "periodicity", + "Koha::Schema::Result::SubscriptionFrequency", + { id => "periodicity" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + =head2 subscriptionroutinglists Type: has_many @@ -492,8 +429,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pzAIpQKBqHodOb1Q4/xIfg +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-30 02:42:01 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JoTdms86n/xfPo8YUnDHUQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/SubscriptionFrequency.pm b/Koha/Schema/Result/SubscriptionFrequency.pm new file mode 100644 index 0000000000..0226a02b6c --- /dev/null +++ b/Koha/Schema/Result/SubscriptionFrequency.pm @@ -0,0 +1,116 @@ +use utf8; +package Koha::Schema::Result::SubscriptionFrequency; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::SubscriptionFrequency + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("subscription_frequencies"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 description + + data_type: 'text' + is_nullable: 0 + +=head2 displayorder + + data_type: 'integer' + is_nullable: 1 + +=head2 unit + + data_type: 'enum' + extra: {list => ["day","week","month","year"]} + is_nullable: 1 + +=head2 unitsperissue + + data_type: 'integer' + default_value: 1 + is_nullable: 0 + +=head2 issuesperunit + + data_type: 'integer' + default_value: 1 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "description", + { data_type => "text", is_nullable => 0 }, + "displayorder", + { data_type => "integer", is_nullable => 1 }, + "unit", + { + data_type => "enum", + extra => { list => ["day", "week", "month", "year"] }, + is_nullable => 1, + }, + "unitsperissue", + { data_type => "integer", default_value => 1, is_nullable => 0 }, + "issuesperunit", + { data_type => "integer", default_value => 1, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 subscriptions + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "subscriptions", + "Koha::Schema::Result::Subscription", + { "foreign.periodicity" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-30 02:42:01 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kOm4+reRTMxUBfVJl4UPig + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/SubscriptionNumberpattern.pm b/Koha/Schema/Result/SubscriptionNumberpattern.pm new file mode 100644 index 0000000000..88e0a36d68 --- /dev/null +++ b/Koha/Schema/Result/SubscriptionNumberpattern.pm @@ -0,0 +1,236 @@ +use utf8; +package Koha::Schema::Result::SubscriptionNumberpattern; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::SubscriptionNumberpattern + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("subscription_numberpatterns"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 label + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 displayorder + + data_type: 'integer' + is_nullable: 1 + +=head2 description + + data_type: 'text' + is_nullable: 0 + +=head2 numberingmethod + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 label1 + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 add1 + + data_type: 'integer' + is_nullable: 1 + +=head2 every1 + + data_type: 'integer' + is_nullable: 1 + +=head2 whenmorethan1 + + data_type: 'integer' + is_nullable: 1 + +=head2 setto1 + + data_type: 'integer' + is_nullable: 1 + +=head2 numbering1 + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 label2 + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 add2 + + data_type: 'integer' + is_nullable: 1 + +=head2 every2 + + data_type: 'integer' + is_nullable: 1 + +=head2 whenmorethan2 + + data_type: 'integer' + is_nullable: 1 + +=head2 setto2 + + data_type: 'integer' + is_nullable: 1 + +=head2 numbering2 + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 label3 + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 add3 + + data_type: 'integer' + is_nullable: 1 + +=head2 every3 + + data_type: 'integer' + is_nullable: 1 + +=head2 whenmorethan3 + + data_type: 'integer' + is_nullable: 1 + +=head2 setto3 + + data_type: 'integer' + is_nullable: 1 + +=head2 numbering3 + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "label", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "displayorder", + { data_type => "integer", is_nullable => 1 }, + "description", + { data_type => "text", is_nullable => 0 }, + "numberingmethod", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "label1", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "add1", + { data_type => "integer", is_nullable => 1 }, + "every1", + { data_type => "integer", is_nullable => 1 }, + "whenmorethan1", + { data_type => "integer", is_nullable => 1 }, + "setto1", + { data_type => "integer", is_nullable => 1 }, + "numbering1", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "label2", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "add2", + { data_type => "integer", is_nullable => 1 }, + "every2", + { data_type => "integer", is_nullable => 1 }, + "whenmorethan2", + { data_type => "integer", is_nullable => 1 }, + "setto2", + { data_type => "integer", is_nullable => 1 }, + "numbering2", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "label3", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "add3", + { data_type => "integer", is_nullable => 1 }, + "every3", + { data_type => "integer", is_nullable => 1 }, + "whenmorethan3", + { data_type => "integer", is_nullable => 1 }, + "setto3", + { data_type => "integer", is_nullable => 1 }, + "numbering3", + { data_type => "varchar", is_nullable => 1, size => 255 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 subscriptions + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "subscriptions", + "Koha::Schema::Result::Subscription", + { "foreign.numberpattern" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-30 02:42:01 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MtVt8WNuJfkeJ2FVoghG5A + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.39.5