From 42ab67bea47b46c9991788da2ef336c92290fba3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 11 Dec 2013 10:44:52 -0500 Subject: [PATCH] Bug 6427 [Part 1] - Update schema files --- Koha/Schema/Result/AccountCredit.pm | 172 ++++++++++++++++++++++++++++ Koha/Schema/Result/AccountDebit.pm | 215 +++++++++++++++++++++++++++++++++++ Koha/Schema/Result/AccountOffset.pm | 118 +++++++++++++++++++ Koha/Schema/Result/Borrower.pm | 137 ++++++++++------------ Koha/Schema/Result/Branch.pm | 52 ++++----- Koha/Schema/Result/Deleteditem.pm | 11 ++ Koha/Schema/Result/Issue.pm | 82 +++++-------- Koha/Schema/Result/OldIssue.pm | 101 ++++++++-------- 8 files changed, 680 insertions(+), 208 deletions(-) create mode 100644 Koha/Schema/Result/AccountCredit.pm create mode 100644 Koha/Schema/Result/AccountDebit.pm create mode 100644 Koha/Schema/Result/AccountOffset.pm diff --git a/Koha/Schema/Result/AccountCredit.pm b/Koha/Schema/Result/AccountCredit.pm new file mode 100644 index 0000000..f6ad7d0 --- /dev/null +++ b/Koha/Schema/Result/AccountCredit.pm @@ -0,0 +1,172 @@ +package Koha::Schema::Result::AccountCredit; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + + +=head1 NAME + +Koha::Schema::Result::AccountCredit + +=cut + +__PACKAGE__->table("account_credits"); + +=head1 ACCESSORS + +=head2 credit_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 borrowernumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 type + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 amount_received + + data_type: 'decimal' + is_nullable: 1 + size: [28,6] + +=head2 amount_paid + + data_type: 'decimal' + is_nullable: 0 + size: [28,6] + +=head2 amount_remaining + + data_type: 'decimal' + is_nullable: 0 + size: [28,6] + +=head2 notes + + data_type: 'text' + is_nullable: 1 + +=head2 branchcode + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + +=head2 manager_id + + data_type: 'integer' + is_nullable: 1 + +=head2 created_on + + data_type: 'timestamp' + is_nullable: 1 + +=head2 updated_on + + data_type: 'timestamp' + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "credit_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "borrowernumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "type", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "amount_received", + { data_type => "decimal", is_nullable => 1, size => [28, 6] }, + "amount_paid", + { data_type => "decimal", is_nullable => 0, size => [28, 6] }, + "amount_remaining", + { data_type => "decimal", is_nullable => 0, size => [28, 6] }, + "notes", + { data_type => "text", is_nullable => 1 }, + "branchcode", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, + "manager_id", + { data_type => "integer", is_nullable => 1 }, + "created_on", + { data_type => "timestamp", is_nullable => 1 }, + "updated_on", + { data_type => "timestamp", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("credit_id"); + +=head1 RELATIONS + +=head2 branchcode + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 borrowernumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "borrowernumber", + "Koha::Schema::Result::Borrower", + { borrowernumber => "borrowernumber" }, + { on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 account_offsets + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "account_offsets", + "Koha::Schema::Result::AccountOffset", + { "foreign.credit_id" => "self.credit_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-12-11 14:04:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2VUFELBmtChTTprhmJGq6A + +__PACKAGE__->belongs_to( + "borrower", + "Koha::Schema::Result::Borrower", + { borrowernumber => "borrowernumber" }, +); + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/AccountDebit.pm b/Koha/Schema/Result/AccountDebit.pm new file mode 100644 index 0000000..b5523d9 --- /dev/null +++ b/Koha/Schema/Result/AccountDebit.pm @@ -0,0 +1,215 @@ +package Koha::Schema::Result::AccountDebit; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + + +=head1 NAME + +Koha::Schema::Result::AccountDebit + +=cut + +__PACKAGE__->table("account_debits"); + +=head1 ACCESSORS + +=head2 debit_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 borrowernumber + + data_type: 'integer' + default_value: 0 + is_foreign_key: 1 + is_nullable: 0 + +=head2 itemnumber + + data_type: 'integer' + is_nullable: 1 + +=head2 issue_id + + data_type: 'integer' + is_nullable: 1 + +=head2 type + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 accruing + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 amount_original + + data_type: 'decimal' + is_nullable: 1 + size: [28,6] + +=head2 amount_outstanding + + data_type: 'decimal' + is_nullable: 1 + size: [28,6] + +=head2 amount_last_increment + + data_type: 'decimal' + is_nullable: 1 + size: [28,6] + +=head2 description + + data_type: 'mediumtext' + is_nullable: 1 + +=head2 notes + + data_type: 'text' + is_nullable: 1 + +=head2 branchcode + + data_type: 'varchar' + is_nullable: 1 + size: 10 + +=head2 manager_id + + data_type: 'integer' + is_nullable: 1 + +=head2 created_on + + data_type: 'timestamp' + is_nullable: 1 + +=head2 updated_on + + data_type: 'timestamp' + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "debit_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "borrowernumber", + { + data_type => "integer", + default_value => 0, + is_foreign_key => 1, + is_nullable => 0, + }, + "itemnumber", + { data_type => "integer", is_nullable => 1 }, + "issue_id", + { data_type => "integer", is_nullable => 1 }, + "type", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "accruing", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "amount_original", + { data_type => "decimal", is_nullable => 1, size => [28, 6] }, + "amount_outstanding", + { data_type => "decimal", is_nullable => 1, size => [28, 6] }, + "amount_last_increment", + { data_type => "decimal", is_nullable => 1, size => [28, 6] }, + "description", + { data_type => "mediumtext", is_nullable => 1 }, + "notes", + { data_type => "text", is_nullable => 1 }, + "branchcode", + { data_type => "varchar", is_nullable => 1, size => 10 }, + "manager_id", + { data_type => "integer", is_nullable => 1 }, + "created_on", + { data_type => "timestamp", is_nullable => 1 }, + "updated_on", + { data_type => "timestamp", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("debit_id"); + +=head1 RELATIONS + +=head2 borrowernumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "borrowernumber", + "Koha::Schema::Result::Borrower", + { borrowernumber => "borrowernumber" }, + { on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 account_offsets + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "account_offsets", + "Koha::Schema::Result::AccountOffset", + { "foreign.debit_id" => "self.debit_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-12-11 14:04:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Yab38AGb5Wh6YEhUyoUPmw + +__PACKAGE__->belongs_to( + "item", + "Koha::Schema::Result::Item", + { itemnumber => "itemnumber" } +); + +__PACKAGE__->belongs_to( + "deleted_item", + "Koha::Schema::Result::Deleteditem", + { itemnumber => "itemnumber" } +); + +__PACKAGE__->belongs_to( + "issue", + "Koha::Schema::Result::Issue", + { issue_id => "issue_id" } +); + +__PACKAGE__->belongs_to( + "old_issue", + "Koha::Schema::Result::OldIssue", + { issue_id => "issue_id" } +); + +__PACKAGE__->belongs_to( + "borrower", + "Koha::Schema::Result::Borrower", + { borrowernumber => "borrowernumber" }, + { on_delete => "CASCADE", on_update => "CASCADE" }, +); + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/AccountOffset.pm b/Koha/Schema/Result/AccountOffset.pm new file mode 100644 index 0000000..179392f --- /dev/null +++ b/Koha/Schema/Result/AccountOffset.pm @@ -0,0 +1,118 @@ +package Koha::Schema::Result::AccountOffset; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + + +=head1 NAME + +Koha::Schema::Result::AccountOffset + +=cut + +__PACKAGE__->table("account_offsets"); + +=head1 ACCESSORS + +=head2 offset_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 debit_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 credit_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 type + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 amount + + data_type: 'decimal' + is_nullable: 0 + size: [28,6] + +=head2 created_on + + data_type: 'timestamp' + default_value: current_timestamp + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "offset_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "debit_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "credit_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "type", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "amount", + { data_type => "decimal", is_nullable => 0, size => [28, 6] }, + "created_on", + { + data_type => "timestamp", + default_value => \"current_timestamp", + is_nullable => 0, + }, +); +__PACKAGE__->set_primary_key("offset_id"); + +=head1 RELATIONS + +=head2 debit + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "debit", + "Koha::Schema::Result::AccountDebit", + { debit_id => "debit_id" }, + { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 credit + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "credit", + "Koha::Schema::Result::AccountCredit", + { credit_id => "credit_id" }, + { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-05 08:47:10 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BLjpL8skXmzxOQ/J0jzdvw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 3d9f9ae..580bbec 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1,21 +1,17 @@ -use utf8; package Koha::Schema::Result::Borrower; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE -=head1 NAME - -Koha::Schema::Result::Borrower - -=cut - use strict; use warnings; use base 'DBIx::Class::Core'; -=head1 TABLE: C + +=head1 NAME + +Koha::Schema::Result::Borrower =cut @@ -191,7 +187,6 @@ __PACKAGE__->table("borrowers"); =head2 dateofbirth data_type: 'date' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 branchcode @@ -213,13 +208,11 @@ __PACKAGE__->table("borrowers"); =head2 dateenrolled data_type: 'date' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 dateexpiry data_type: 'date' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 gonenoaddress @@ -235,7 +228,6 @@ __PACKAGE__->table("borrowers"); =head2 debarred data_type: 'date' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 debarredcomment @@ -397,6 +389,13 @@ __PACKAGE__->table("borrowers"); default_value: 1 is_nullable: 0 +=head2 account_balance + + data_type: 'decimal' + default_value: 0.000000 + is_nullable: 0 + size: [28,6] + =cut __PACKAGE__->add_columns( @@ -463,7 +462,7 @@ __PACKAGE__->add_columns( "b_phone", { data_type => "mediumtext", is_nullable => 1 }, "dateofbirth", - { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + { data_type => "date", is_nullable => 1 }, "branchcode", { data_type => "varchar", @@ -481,15 +480,15 @@ __PACKAGE__->add_columns( size => 10, }, "dateenrolled", - { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + { data_type => "date", is_nullable => 1 }, "dateexpiry", - { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + { data_type => "date", is_nullable => 1 }, "gonenoaddress", { data_type => "tinyint", is_nullable => 1 }, "lost", { data_type => "tinyint", is_nullable => 1 }, "debarred", - { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, + { data_type => "date", is_nullable => 1 }, "debarredcomment", { data_type => "varchar", is_nullable => 1, size => 255 }, "contactname", @@ -546,35 +545,48 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 50 }, "privacy", { data_type => "integer", default_value => 1, is_nullable => 0 }, + "account_balance", + { + data_type => "decimal", + default_value => "0.000000", + is_nullable => 0, + size => [28, 6], + }, ); +__PACKAGE__->set_primary_key("borrowernumber"); +__PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]); -=head1 PRIMARY KEY +=head1 RELATIONS -=over 4 +=head2 account_credits -=item * L +Type: has_many -=back +Related object: L =cut -__PACKAGE__->set_primary_key("borrowernumber"); - -=head1 UNIQUE CONSTRAINTS - -=head2 C +__PACKAGE__->has_many( + "account_credits", + "Koha::Schema::Result::AccountCredit", + { "foreign.borrowernumber" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); -=over 4 +=head2 account_debits -=item * L +Type: has_many -=back +Related object: L =cut -__PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]); - -=head1 RELATIONS +__PACKAGE__->has_many( + "account_debits", + "Koha::Schema::Result::AccountDebit", + { "foreign.borrowernumber" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); =head2 accountlines @@ -696,34 +708,34 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 branchcode +=head2 categorycode Type: belongs_to -Related object: L +Related object: L =cut __PACKAGE__->belongs_to( - "branchcode", - "Koha::Schema::Result::Branch", - { branchcode => "branchcode" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + "categorycode", + "Koha::Schema::Result::Category", + { categorycode => "categorycode" }, + { on_delete => "CASCADE", on_update => "CASCADE" }, ); -=head2 categorycode +=head2 branchcode Type: belongs_to -Related object: L +Related object: L =cut __PACKAGE__->belongs_to( - "categorycode", - "Koha::Schema::Result::Category", - { categorycode => "categorycode" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + "branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { on_delete => "CASCADE", on_update => "CASCADE" }, ); =head2 course_instructors @@ -1041,40 +1053,15 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 basketnoes - -Type: many_to_many - -Composing rels: L -> basketno - -=cut - -__PACKAGE__->many_to_many("basketnoes", "aqbasketusers", "basketno"); - -=head2 budgets - -Type: many_to_many - -Composing rels: L -> budget - -=cut - -__PACKAGE__->many_to_many("budgets", "aqbudgetborrowers", "budget"); - -=head2 courses - -Type: many_to_many -Composing rels: L -> course - -=cut - -__PACKAGE__->many_to_many("courses", "course_instructors", "course"); - - -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-31 16:31:19 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z4kW3xYX1CyrwvGdZu32nA +# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-12 08:27:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CcXsGi7pVHQtO+YH3pY/1A +__PACKAGE__->belongs_to( + "branch", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, +); # You can replace this text with custom content, and it will be preserved on regeneration 1; diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index ec25add..adfd718 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -1,21 +1,17 @@ -use utf8; package Koha::Schema::Result::Branch; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE -=head1 NAME - -Koha::Schema::Result::Branch - -=cut - use strict; use warnings; use base 'DBIx::Class::Core'; -=head1 TABLE: C + +=head1 NAME + +Koha::Schema::Result::Branch =cut @@ -158,20 +154,24 @@ __PACKAGE__->add_columns( "opac_info", { data_type => "text", is_nullable => 1 }, ); +__PACKAGE__->set_primary_key("branchcode"); -=head1 PRIMARY KEY +=head1 RELATIONS -=over 4 +=head2 account_credits -=item * L +Type: has_many -=back +Related object: L =cut -__PACKAGE__->set_primary_key("branchcode"); - -=head1 RELATIONS +__PACKAGE__->has_many( + "account_credits", + "Koha::Schema::Result::AccountCredit", + { "foreign.branchcode" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); =head2 aqbaskets @@ -383,7 +383,7 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 items_holdingbranches +=head2 items_homebranches Type: has_many @@ -392,13 +392,13 @@ Related object: L =cut __PACKAGE__->has_many( - "items_holdingbranches", + "items_homebranches", "Koha::Schema::Result::Item", - { "foreign.holdingbranch" => "self.branchcode" }, + { "foreign.homebranch" => "self.branchcode" }, { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 items_homebranches +=head2 items_holdingbranches Type: has_many @@ -407,9 +407,9 @@ Related object: L =cut __PACKAGE__->has_many( - "items_homebranches", + "items_holdingbranches", "Koha::Schema::Result::Item", - { "foreign.homebranch" => "self.branchcode" }, + { "foreign.holdingbranch" => "self.branchcode" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -473,16 +473,6 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 categorycodes - -Type: many_to_many - -Composing rels: L -> categorycode - -=cut - -__PACKAGE__->many_to_many("categorycodes", "branchrelations", "categorycode"); - # Created by DBIx::Class::Schema::Loader v0.07025 @ 2014-04-08 22:40:15 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1RVlM6TXiG4B7szUQSN64Q diff --git a/Koha/Schema/Result/Deleteditem.pm b/Koha/Schema/Result/Deleteditem.pm index 152d397..05c6a0a 100644 --- a/Koha/Schema/Result/Deleteditem.pm +++ b/Koha/Schema/Result/Deleteditem.pm @@ -383,6 +383,17 @@ __PACKAGE__->set_primary_key("itemnumber"); # Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-12-23 16:39:42 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ji1W0q5g5xTw1J89cjVlWw +__PACKAGE__->belongs_to( + "biblio", + "Koha::Schema::Result::Biblio", + { biblionumber => "biblionumber" } +); + +__PACKAGE__->belongs_to( + "deleted_biblio", + "Koha::Schema::Result::Deletedbiblio", + { biblionumber => "biblionumber" } +); # You can replace this text with custom content, and it will be preserved on regeneration 1; diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm index 282c802..d5ee1b1 100644 --- a/Koha/Schema/Result/Issue.pm +++ b/Koha/Schema/Result/Issue.pm @@ -1,21 +1,17 @@ -use utf8; package Koha::Schema::Result::Issue; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE -=head1 NAME - -Koha::Schema::Result::Issue - -=cut - use strict; use warnings; use base 'DBIx::Class::Core'; -=head1 TABLE: C + +=head1 NAME + +Koha::Schema::Result::Issue =cut @@ -23,6 +19,12 @@ __PACKAGE__->table("issues"); =head1 ACCESSORS +=head2 issue_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + =head2 borrowernumber data_type: 'integer' @@ -38,7 +40,6 @@ __PACKAGE__->table("issues"); =head2 date_due data_type: 'datetime' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 branchcode @@ -56,13 +57,11 @@ __PACKAGE__->table("issues"); =head2 returndate data_type: 'datetime' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 lastreneweddate data_type: 'datetime' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 return @@ -79,63 +78,47 @@ __PACKAGE__->table("issues"); =head2 timestamp data_type: 'timestamp' - datetime_undef_if_invalid: 1 default_value: current_timestamp is_nullable: 0 =head2 issuedate data_type: 'datetime' - datetime_undef_if_invalid: 1 is_nullable: 1 =cut __PACKAGE__->add_columns( + "issue_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "borrowernumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "itemnumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "date_due", - { - data_type => "datetime", - datetime_undef_if_invalid => 1, - is_nullable => 1, - }, + { data_type => "datetime", is_nullable => 1 }, "branchcode", { data_type => "varchar", is_nullable => 1, size => 10 }, "issuingbranch", { data_type => "varchar", is_nullable => 1, size => 18 }, "returndate", - { - data_type => "datetime", - datetime_undef_if_invalid => 1, - is_nullable => 1, - }, + { data_type => "datetime", is_nullable => 1 }, "lastreneweddate", - { - data_type => "datetime", - datetime_undef_if_invalid => 1, - is_nullable => 1, - }, + { data_type => "datetime", is_nullable => 1 }, "return", { data_type => "varchar", is_nullable => 1, size => 4 }, "renewals", { data_type => "tinyint", is_nullable => 1 }, "timestamp", { - data_type => "timestamp", - datetime_undef_if_invalid => 1, + data_type => "timestamp", default_value => \"current_timestamp", - is_nullable => 0, + is_nullable => 0, }, "issuedate", - { - data_type => "datetime", - datetime_undef_if_invalid => 1, - is_nullable => 1, - }, + { data_type => "datetime", is_nullable => 1 }, ); +__PACKAGE__->set_primary_key("issue_id"); =head1 RELATIONS @@ -151,12 +134,7 @@ __PACKAGE__->belongs_to( "borrowernumber", "Koha::Schema::Result::Borrower", { borrowernumber => "borrowernumber" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", - }, + { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, ); =head2 itemnumber @@ -171,23 +149,25 @@ __PACKAGE__->belongs_to( "itemnumber", "Koha::Schema::Result::Item", { itemnumber => "itemnumber" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", - }, + { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZEh31EKBmURMKxDxI+H3EA +# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-12 09:32:52 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zBewWFig+yZYtSkcIxCZpg __PACKAGE__->belongs_to( "borrower", "Koha::Schema::Result::Borrower", { borrowernumber => "borrowernumber" }, - { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, + { join_type => "LEFT" }, +); + +__PACKAGE__->belongs_to( + "item", + "Koha::Schema::Result::Item", + { itemnumber => "itemnumber" }, + { join_type => "LEFT" }, ); 1; diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm index 4050f06..fe0dc00 100644 --- a/Koha/Schema/Result/OldIssue.pm +++ b/Koha/Schema/Result/OldIssue.pm @@ -1,21 +1,17 @@ -use utf8; package Koha::Schema::Result::OldIssue; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE -=head1 NAME - -Koha::Schema::Result::OldIssue - -=cut - use strict; use warnings; use base 'DBIx::Class::Core'; -=head1 TABLE: C + +=head1 NAME + +Koha::Schema::Result::OldIssue =cut @@ -23,6 +19,12 @@ __PACKAGE__->table("old_issues"); =head1 ACCESSORS +=head2 issue_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + =head2 borrowernumber data_type: 'integer' @@ -38,7 +40,6 @@ __PACKAGE__->table("old_issues"); =head2 date_due data_type: 'datetime' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 branchcode @@ -56,13 +57,11 @@ __PACKAGE__->table("old_issues"); =head2 returndate data_type: 'datetime' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 lastreneweddate data_type: 'datetime' - datetime_undef_if_invalid: 1 is_nullable: 1 =head2 return @@ -79,63 +78,47 @@ __PACKAGE__->table("old_issues"); =head2 timestamp data_type: 'timestamp' - datetime_undef_if_invalid: 1 default_value: current_timestamp is_nullable: 0 =head2 issuedate data_type: 'datetime' - datetime_undef_if_invalid: 1 is_nullable: 1 =cut __PACKAGE__->add_columns( + "issue_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "borrowernumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "itemnumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "date_due", - { - data_type => "datetime", - datetime_undef_if_invalid => 1, - is_nullable => 1, - }, + { data_type => "datetime", is_nullable => 1 }, "branchcode", { data_type => "varchar", is_nullable => 1, size => 10 }, "issuingbranch", { data_type => "varchar", is_nullable => 1, size => 18 }, "returndate", - { - data_type => "datetime", - datetime_undef_if_invalid => 1, - is_nullable => 1, - }, + { data_type => "datetime", is_nullable => 1 }, "lastreneweddate", - { - data_type => "datetime", - datetime_undef_if_invalid => 1, - is_nullable => 1, - }, + { data_type => "datetime", is_nullable => 1 }, "return", { data_type => "varchar", is_nullable => 1, size => 4 }, "renewals", { data_type => "tinyint", is_nullable => 1 }, "timestamp", { - data_type => "timestamp", - datetime_undef_if_invalid => 1, + data_type => "timestamp", default_value => \"current_timestamp", - is_nullable => 0, + is_nullable => 0, }, "issuedate", - { - data_type => "datetime", - datetime_undef_if_invalid => 1, - is_nullable => 1, - }, + { data_type => "datetime", is_nullable => 1 }, ); +__PACKAGE__->set_primary_key("issue_id"); =head1 RELATIONS @@ -151,12 +134,7 @@ __PACKAGE__->belongs_to( "borrowernumber", "Koha::Schema::Result::Borrower", { borrowernumber => "borrowernumber" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", - }, + { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, ); =head2 itemnumber @@ -171,18 +149,39 @@ __PACKAGE__->belongs_to( "itemnumber", "Koha::Schema::Result::Item", { itemnumber => "itemnumber" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", - }, + { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uPOxNROoMMRZ0qZsXsxEjA +# Created by DBIx::Class::Schema::Loader v0.07000 @ 2014-01-10 09:07:09 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:agfOaMcPE8kpA7LTKCfcCA +__PACKAGE__->belongs_to( + "borrower", + "Koha::Schema::Result::Borrower", + { borrowernumber => "borrowernumber" }, + { join_type => "LEFT" }, +); + +__PACKAGE__->belongs_to( + "item", + "Koha::Schema::Result::Item", + { itemnumber => "itemnumber" }, + { join_type => "LEFT" }, +); + +__PACKAGE__->belongs_to( + "deletedborrower", + "Koha::Schema::Result::Deletedborrower", + { borrowernumber => "borrowernumber" }, + { join_type => "LEFT" }, +); + +__PACKAGE__->belongs_to( + "deleteditem", + "Koha::Schema::Result::Deleteditem", + { itemnumber => "itemnumber" }, + { join_type => "LEFT" }, +); -# You can replace this text with custom content, and it will be preserved on regeneration 1; -- 1.7.2.5