Bugzilla – Attachment 122979 Details for
Bug 25260
Merge 'reserves' and 'old_reserves' into a new 'holds' table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25260: Schema files
Bug-25260-Schema-files.patch (text/plain), 33.77 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-07-20 16:35:28 UTC
(
hide
)
Description:
Bug 25260: Schema files
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-07-20 16:35:28 UTC
Size:
33.77 KB
patch
obsolete
>From ecd12a0402c0e385fcf0e0752ed3d8a2d5ec685b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 23 Dec 2020 15:18:05 -0300 >Subject: [PATCH] Bug 25260: Schema files > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Schema/Result/Biblio.pm | 37 +- > Koha/Schema/Result/Borrower.pm | 49 +-- > Koha/Schema/Result/Branch.pm | 34 +- > Koha/Schema/Result/ClubHoldsToPatronHold.pm | 10 +- > Koha/Schema/Result/Desk.pm | 12 +- > Koha/Schema/Result/Item.pm | 49 +-- > Koha/Schema/Result/Itemtype.pm | 47 +-- > Koha/Schema/Result/OldReserve.pm | 336 +++------------- > Koha/Schema/Result/Reserve.pm | 405 +++----------------- > 9 files changed, 197 insertions(+), 782 deletions(-) > >diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm >index dd14f2d807..5c62b9749a 100644 >--- a/Koha/Schema/Result/Biblio.pm >+++ b/Koha/Schema/Result/Biblio.pm >@@ -315,32 +315,32 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 items >+=head2 holds > > Type: has_many > >-Related object: L<Koha::Schema::Result::Item> >+Related object: L<Koha::Schema::Result::Hold> > > =cut > > __PACKAGE__->has_many( >- "items", >- "Koha::Schema::Result::Item", >- { "foreign.biblionumber" => "self.biblionumber" }, >+ "holds", >+ "Koha::Schema::Result::Hold", >+ { "foreign.biblio_id" => "self.biblionumber" }, > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 old_reserves >+=head2 items > > Type: has_many > >-Related object: L<Koha::Schema::Result::OldReserve> >+Related object: L<Koha::Schema::Result::Item> > > =cut > > __PACKAGE__->has_many( >- "old_reserves", >- "Koha::Schema::Result::OldReserve", >+ "items", >+ "Koha::Schema::Result::Item", > { "foreign.biblionumber" => "self.biblionumber" }, > { cascade_copy => 0, cascade_delete => 0 }, > ); >@@ -360,21 +360,6 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 reserves >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::Reserve> >- >-=cut >- >-__PACKAGE__->has_many( >- "reserves", >- "Koha::Schema::Result::Reserve", >- { "foreign.biblionumber" => "self.biblionumber" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- > =head2 reviews > > Type: has_many >@@ -496,8 +481,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-02-03 10:03:26 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YVZN5K/K1v7Kj2yYGwT2CQ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-12 20:48:09 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N7iCWBcFJ/LxHQdGs8ewTw > > __PACKAGE__->has_many( > "biblioitem", >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 68abbc11aa..0f451615e3 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -1214,6 +1214,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 holds >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Hold> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "holds", >+ "Koha::Schema::Result::Hold", >+ { "foreign.patron_id" => "self.borrowernumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 housebound_profile > > Type: might_have >@@ -1424,21 +1439,6 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 old_reserves >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::OldReserve> >- >-=cut >- >-__PACKAGE__->has_many( >- "old_reserves", >- "Koha::Schema::Result::OldReserve", >- { "foreign.borrowernumber" => "self.borrowernumber" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- > =head2 opac_news > > Type: has_many >@@ -1544,21 +1544,6 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 reserves >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::Reserve> >- >-=cut >- >-__PACKAGE__->has_many( >- "reserves", >- "Koha::Schema::Result::Reserve", >- { "foreign.borrowernumber" => "self.borrowernumber" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- > =head2 return_claims_borrowernumbers > > Type: has_many >@@ -1875,8 +1860,8 @@ Composing rels: L</aqorder_users> -> ordernumber > __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-12 13:40:00 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IKPb4912o8oCHtmFAi6FPQ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-12 20:48:09 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:X0M9kJAk7bO5oFOHXUorKQ > > __PACKAGE__->add_columns( > '+anonymized' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm >index 87f4ec190f..b1ad69adbe 100644 >--- a/Koha/Schema/Result/Branch.pm >+++ b/Koha/Schema/Result/Branch.pm >@@ -631,6 +631,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 holds >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Hold> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "holds", >+ "Koha::Schema::Result::Hold", >+ { "foreign.pickup_library_id" => "self.branchcode" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 illrequests > > Type: has_many >@@ -796,21 +811,6 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 reserves >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::Reserve> >- >-=cut >- >-__PACKAGE__->has_many( >- "reserves", >- "Koha::Schema::Result::Reserve", >- { "foreign.branchcode" => "self.branchcode" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- > =head2 special_holidays > > Type: has_many >@@ -887,8 +887,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uu8m3hyDhM50oTSeNTJbdg >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-01-27 19:57:36 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:scFksQ0UIScBex3j6VU8bw > > __PACKAGE__->add_columns( > '+pickup_location' => { is_boolean => 1 } >diff --git a/Koha/Schema/Result/ClubHoldsToPatronHold.pm b/Koha/Schema/Result/ClubHoldsToPatronHold.pm >index fd1aa86298..96c5a75254 100644 >--- a/Koha/Schema/Result/ClubHoldsToPatronHold.pm >+++ b/Koha/Schema/Result/ClubHoldsToPatronHold.pm >@@ -128,14 +128,14 @@ __PACKAGE__->belongs_to( > > Type: belongs_to > >-Related object: L<Koha::Schema::Result::Reserve> >+Related object: L<Koha::Schema::Result::Hold> > > =cut > > __PACKAGE__->belongs_to( > "hold", >- "Koha::Schema::Result::Reserve", >- { reserve_id => "hold_id" }, >+ "Koha::Schema::Result::Hold", >+ { id => "hold_id" }, > { > is_deferrable => 1, > join_type => "LEFT", >@@ -160,8 +160,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-08-04 18:43:05 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KjJWzFhPwQk0SZqrHQ4Alw >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-12 11:40:08 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7BEtGibjktT8MUPfLlY9Lw > > sub koha_objects_class { > 'Koha::Club::Hold::PatronHolds'; >diff --git a/Koha/Schema/Result/Desk.pm b/Koha/Schema/Result/Desk.pm >index 20aae97fe0..446b958c89 100644 >--- a/Koha/Schema/Result/Desk.pm >+++ b/Koha/Schema/Result/Desk.pm >@@ -89,24 +89,24 @@ __PACKAGE__->belongs_to( > { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, > ); > >-=head2 reserves >+=head2 holds > > Type: has_many > >-Related object: L<Koha::Schema::Result::Reserve> >+Related object: L<Koha::Schema::Result::Hold> > > =cut > > __PACKAGE__->has_many( >- "reserves", >- "Koha::Schema::Result::Reserve", >+ "holds", >+ "Koha::Schema::Result::Hold", > { "foreign.desk_id" => "self.desk_id" }, > { cascade_copy => 0, cascade_delete => 0 }, > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7qeCP25arGQpM4xxnTmWbw >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-01-27 19:57:36 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PkVcz/kbAu/zfbtztuJX9Q > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index 1d818126a4..8f2092c70a 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -694,6 +694,21 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 holds >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Hold> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "holds", >+ "Koha::Schema::Result::Hold", >+ { "foreign.item_id" => "self.itemnumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 homebranch > > Type: belongs_to >@@ -759,36 +774,6 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 old_reserves >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::OldReserve> >- >-=cut >- >-__PACKAGE__->has_many( >- "old_reserves", >- "Koha::Schema::Result::OldReserve", >- { "foreign.itemnumber" => "self.itemnumber" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- >-=head2 reserves >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::Reserve> >- >-=cut >- >-__PACKAGE__->has_many( >- "reserves", >- "Koha::Schema::Result::Reserve", >- { "foreign.itemnumber" => "self.itemnumber" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- > =head2 return_claims > > Type: has_many >@@ -850,8 +835,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:U5Tm2JfUnfhACRDJ4SpFgQ >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-01-27 19:57:36 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WuEFNsbl8eRji9xY1b2MdA > > __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); > >diff --git a/Koha/Schema/Result/Itemtype.pm b/Koha/Schema/Result/Itemtype.pm >index 1e14063e1d..69adeeba89 100644 >--- a/Koha/Schema/Result/Itemtype.pm >+++ b/Koha/Schema/Result/Itemtype.pm >@@ -252,47 +252,47 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 itemtypes >+=head2 holds > > Type: has_many > >-Related object: L<Koha::Schema::Result::Itemtype> >+Related object: L<Koha::Schema::Result::Hold> > > =cut > > __PACKAGE__->has_many( >- "itemtypes", >- "Koha::Schema::Result::Itemtype", >- { "foreign.parent_type" => "self.itemtype" }, >+ "holds", >+ "Koha::Schema::Result::Hold", >+ { "foreign.item_type" => "self.itemtype" }, > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 itemtypes_branches >+=head2 itemtypes > > Type: has_many > >-Related object: L<Koha::Schema::Result::ItemtypesBranch> >+Related object: L<Koha::Schema::Result::Itemtype> > > =cut > > __PACKAGE__->has_many( >- "itemtypes_branches", >- "Koha::Schema::Result::ItemtypesBranch", >- { "foreign.itemtype" => "self.itemtype" }, >+ "itemtypes", >+ "Koha::Schema::Result::Itemtype", >+ { "foreign.parent_type" => "self.itemtype" }, > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 old_reserves >+=head2 itemtypes_branches > > Type: has_many > >-Related object: L<Koha::Schema::Result::OldReserve> >+Related object: L<Koha::Schema::Result::ItemtypesBranch> > > =cut > > __PACKAGE__->has_many( >- "old_reserves", >- "Koha::Schema::Result::OldReserve", >+ "itemtypes_branches", >+ "Koha::Schema::Result::ItemtypesBranch", > { "foreign.itemtype" => "self.itemtype" }, > { cascade_copy => 0, cascade_delete => 0 }, > ); >@@ -317,24 +317,9 @@ __PACKAGE__->belongs_to( > }, > ); > >-=head2 reserves >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::Reserve> >- >-=cut >- >-__PACKAGE__->has_many( >- "reserves", >- "Koha::Schema::Result::Reserve", >- { "foreign.itemtype" => "self.itemtype" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-04-22 09:12:04 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/kFAnQQ7q1KaLJ9h7vk0vg >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-12 20:48:10 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c6EdLE+NviawpsphjoDDsw > > __PACKAGE__->add_columns( > '+rentalcharge_hourly_calendar' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm >index 05174e1566..0b58072607 100644 >--- a/Koha/Schema/Result/OldReserve.pm >+++ b/Koha/Schema/Result/OldReserve.pm >@@ -25,387 +25,161 @@ __PACKAGE__->table("old_reserves"); > > =head2 reserve_id > >- data_type: 'integer' >+ data_type: 'tinyint' > is_nullable: 0 > >-primary key >- > =head2 borrowernumber > >- data_type: 'integer' >- is_foreign_key: 1 >- is_nullable: 1 >- >-foreign key from the borrowers table defining which patron this hold is for >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 reservedate > >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-the date the hold was places >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 biblionumber > >- data_type: 'integer' >- is_foreign_key: 1 >- is_nullable: 1 >- >-foreign key from the biblio table defining which bib record this hold is on >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 branchcode > >- data_type: 'varchar' >- is_nullable: 1 >- size: 10 >- >-foreign key from the branches table defining which branch the patron wishes to pick this hold up at >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 desk_id > >- data_type: 'integer' >- is_nullable: 1 >- >-foreign key from the desks table defining which desk the patron should pick this hold up at >- >-=head2 notificationdate >- >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-currently unused >- >-=head2 reminderdate >- >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-currently unused >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 cancellationdate > >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-the date this hold was cancelled >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 cancellation_reason > >- data_type: 'varchar' >- is_nullable: 1 >- size: 80 >- >-optional authorised value CANCELLATION_REASON >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 reservenotes > >- data_type: 'longtext' >- is_nullable: 1 >- >-notes related to this hold >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 priority > >- data_type: 'smallint' >- default_value: 1 >+ data_type: 'tinyint' > is_nullable: 0 > >-where in the queue the patron sits >- > =head2 found > >- data_type: 'varchar' >- is_nullable: 1 >- size: 1 >- >-a one letter code defining what the status is of the hold is after it has been confirmed >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 timestamp > >- data_type: 'timestamp' >- datetime_undef_if_invalid: 1 >- default_value: current_timestamp >+ data_type: 'tinyint' > is_nullable: 0 > >-the date and time this hold was last updated >- > =head2 itemnumber > >- data_type: 'integer' >- is_foreign_key: 1 >- is_nullable: 1 >- >-foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 waitingdate > >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-the date the item was marked as waiting for the patron at the library >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 expirationdate > >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-the date the hold expires (usually the date entered by the patron to say they don't need the hold after a certain date) >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 lowestPriority > > accessor: 'lowest_priority' > data_type: 'tinyint' >- default_value: 0 > is_nullable: 0 > >-has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no) >- > =head2 suspend > > data_type: 'tinyint' >- default_value: 0 > is_nullable: 0 > >-in this hold suspended (1 for yes, 0 for no) >- > =head2 suspend_until > >- data_type: 'datetime' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-the date this hold is suspended until (NULL for infinitely) >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 itemtype > >- data_type: 'varchar' >- is_foreign_key: 1 >- is_nullable: 1 >- size: 10 >- >-If record level hold, the optional itemtype of the item the patron is requesting >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 item_level_hold > > data_type: 'tinyint' >- default_value: 0 > is_nullable: 0 > >-Is the hpld placed at item level >- > =head2 non_priority > > data_type: 'tinyint' >- default_value: 0 > is_nullable: 0 > >-Is this a non priority hold >- > =cut > > __PACKAGE__->add_columns( > "reserve_id", >- { data_type => "integer", is_nullable => 0 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "borrowernumber", >- { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "reservedate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "biblionumber", >- { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "branchcode", >- { data_type => "varchar", is_nullable => 1, size => 10 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "desk_id", >- { data_type => "integer", is_nullable => 1 }, >- "notificationdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >- "reminderdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "cancellationdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "cancellation_reason", >- { data_type => "varchar", is_nullable => 1, size => 80 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "reservenotes", >- { data_type => "longtext", is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "priority", >- { data_type => "smallint", default_value => 1, is_nullable => 0 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "found", >- { data_type => "varchar", is_nullable => 1, size => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "timestamp", >- { >- data_type => "timestamp", >- datetime_undef_if_invalid => 1, >- default_value => \"current_timestamp", >- is_nullable => 0, >- }, >+ { data_type => "tinyint", is_nullable => 0 }, > "itemnumber", >- { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "waitingdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "expirationdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "lowestPriority", >- { >- accessor => "lowest_priority", >- data_type => "tinyint", >- default_value => 0, >- is_nullable => 0, >- }, >+ { accessor => "lowest_priority", data_type => "tinyint", is_nullable => 0 }, > "suspend", >- { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "suspend_until", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "tinyint", is_nullable => 0 }, > "itemtype", >- { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "item_level_hold", >- { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "non_priority", >- { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >-); >- >-=head1 PRIMARY KEY >- >-=over 4 >- >-=item * L</reserve_id> >- >-=back >- >-=cut >- >-__PACKAGE__->set_primary_key("reserve_id"); >- >-=head1 RELATIONS >- >-=head2 biblionumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Biblio> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "biblionumber", >- "Koha::Schema::Result::Biblio", >- { biblionumber => "biblionumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "SET NULL", >- on_update => "SET NULL", >- }, >-); >- >-=head2 borrowernumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Borrower> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "borrowernumber", >- "Koha::Schema::Result::Borrower", >- { borrowernumber => "borrowernumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "SET NULL", >- on_update => "SET NULL", >- }, >-); >- >-=head2 itemnumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Item> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "itemnumber", >- "Koha::Schema::Result::Item", >- { itemnumber => "itemnumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "SET NULL", >- on_update => "SET NULL", >- }, >+ { data_type => "tinyint", is_nullable => 0 }, > ); > >-=head2 itemtype >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Itemtype> > >-=cut >- >-__PACKAGE__->belongs_to( >- "itemtype", >- "Koha::Schema::Result::Itemtype", >- { itemtype => "itemtype" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "SET NULL", >- on_update => "SET NULL", >- }, >-); >- >- >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aVQsdX811LswCsWyBqkSbQ >- >-__PACKAGE__->belongs_to( >- "item", >- "Koha::Schema::Result::Item", >- { itemnumber => "itemnumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >-); >- >-__PACKAGE__->belongs_to( >- "biblio", >- "Koha::Schema::Result::Biblio", >- { biblionumber => "biblionumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >-); >- >-__PACKAGE__->add_columns( >- '+item_level_hold' => { is_boolean => 1 }, >- '+lowestPriority' => { is_boolean => 1 }, >- '+suspend' => { is_boolean => 1 }, >- '+non_priority' => { is_boolean => 1 } >-); >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-19 14:50:01 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8lk8geAXvaDPVo9jW8Tv8Q > >-sub koha_object_class { >- 'Koha::Old::Hold'; >-} >-sub koha_objects_class { >- 'Koha::Old::Holds'; >-} > >+# You can replace this text with custom code or comments, and it will be preserved on regeneration > 1; >diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm >index 8ddda1437c..2e8f2704a8 100644 >--- a/Koha/Schema/Result/Reserve.pm >+++ b/Koha/Schema/Result/Reserve.pm >@@ -25,460 +25,161 @@ __PACKAGE__->table("reserves"); > > =head2 reserve_id > >- data_type: 'integer' >- is_auto_increment: 1 >+ data_type: 'tinyint' > is_nullable: 0 > >-primary key >- > =head2 borrowernumber > >- data_type: 'integer' >- default_value: 0 >- is_foreign_key: 1 >+ data_type: 'tinyint' > is_nullable: 0 > >-foreign key from the borrowers table defining which patron this hold is for >- > =head2 reservedate > >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-the date the hold was placed >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 biblionumber > >- data_type: 'integer' >- default_value: 0 >- is_foreign_key: 1 >+ data_type: 'tinyint' > is_nullable: 0 > >-foreign key from the biblio table defining which bib record this hold is on >- > =head2 branchcode > >- data_type: 'varchar' >- is_foreign_key: 1 >- is_nullable: 1 >- size: 10 >- >-foreign key from the branches table defining which branch the patron wishes to pick this hold up at >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 desk_id > >- data_type: 'integer' >- is_foreign_key: 1 >- is_nullable: 1 >- >-foreign key from the desks table defining which desk the patron should pick this hold up at >- >-=head2 notificationdate >- >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-currently unused >- >-=head2 reminderdate >- >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-currently unused >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 cancellationdate > >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-the date this hold was cancelled >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 cancellation_reason > >- data_type: 'varchar' >- is_nullable: 1 >- size: 80 >- >-optional authorised value CANCELLATION_REASON >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 reservenotes > >- data_type: 'longtext' >- is_nullable: 1 >- >-notes related to this hold >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 priority > >- data_type: 'smallint' >- default_value: 1 >+ data_type: 'tinyint' > is_nullable: 0 > >-where in the queue the patron sits >- > =head2 found > >- data_type: 'varchar' >- is_nullable: 1 >- size: 1 >- >-a one letter code defining what the status is of the hold is after it has been confirmed >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 timestamp > >- data_type: 'timestamp' >- datetime_undef_if_invalid: 1 >- default_value: current_timestamp >+ data_type: 'tinyint' > is_nullable: 0 > >-the date and time this hold was last updated >- > =head2 itemnumber > >- data_type: 'integer' >- is_foreign_key: 1 >- is_nullable: 1 >- >-foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 waitingdate > >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-the date the item was marked as waiting for the patron at the library >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 expirationdate > >- data_type: 'date' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >- >-the date the hold expires (usually the date entered by the patron to say they don't need the hold after a certain date) >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 lowestPriority > > accessor: 'lowest_priority' > data_type: 'tinyint' >- default_value: 0 > is_nullable: 0 > > =head2 suspend > > data_type: 'tinyint' >- default_value: 0 > is_nullable: 0 > > =head2 suspend_until > >- data_type: 'datetime' >- datetime_undef_if_invalid: 1 >- is_nullable: 1 >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 itemtype > >- data_type: 'varchar' >- is_foreign_key: 1 >- is_nullable: 1 >- size: 10 >- >-If record level hold, the optional itemtype of the item the patron is requesting >+ data_type: 'tinyint' >+ is_nullable: 0 > > =head2 item_level_hold > > data_type: 'tinyint' >- default_value: 0 > is_nullable: 0 > >-Is the hpld placed at item level >- > =head2 non_priority > > data_type: 'tinyint' >- default_value: 0 > is_nullable: 0 > >-Is this a non priority hold >- > =cut > > __PACKAGE__->add_columns( > "reserve_id", >- { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "borrowernumber", >- { >- data_type => "integer", >- default_value => 0, >- is_foreign_key => 1, >- is_nullable => 0, >- }, >+ { data_type => "tinyint", is_nullable => 0 }, > "reservedate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "biblionumber", >- { >- data_type => "integer", >- default_value => 0, >- is_foreign_key => 1, >- is_nullable => 0, >- }, >+ { data_type => "tinyint", is_nullable => 0 }, > "branchcode", >- { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "desk_id", >- { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >- "notificationdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >- "reminderdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "cancellationdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "cancellation_reason", >- { data_type => "varchar", is_nullable => 1, size => 80 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "reservenotes", >- { data_type => "longtext", is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "priority", >- { data_type => "smallint", default_value => 1, is_nullable => 0 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "found", >- { data_type => "varchar", is_nullable => 1, size => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "timestamp", >- { >- data_type => "timestamp", >- datetime_undef_if_invalid => 1, >- default_value => \"current_timestamp", >- is_nullable => 0, >- }, >+ { data_type => "tinyint", is_nullable => 0 }, > "itemnumber", >- { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "waitingdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "expirationdate", >- { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "lowestPriority", >- { >- accessor => "lowest_priority", >- data_type => "tinyint", >- default_value => 0, >- is_nullable => 0, >- }, >+ { accessor => "lowest_priority", data_type => "tinyint", is_nullable => 0 }, > "suspend", >- { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "suspend_until", >- { >- data_type => "datetime", >- datetime_undef_if_invalid => 1, >- is_nullable => 1, >- }, >+ { data_type => "tinyint", is_nullable => 0 }, > "itemtype", >- { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "item_level_hold", >- { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+ { data_type => "tinyint", is_nullable => 0 }, > "non_priority", >- { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >-); >- >-=head1 PRIMARY KEY >- >-=over 4 >- >-=item * L</reserve_id> >- >-=back >- >-=cut >- >-__PACKAGE__->set_primary_key("reserve_id"); >- >-=head1 RELATIONS >- >-=head2 biblionumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Biblio> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "biblionumber", >- "Koha::Schema::Result::Biblio", >- { biblionumber => "biblionumber" }, >- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+ { data_type => "tinyint", is_nullable => 0 }, > ); > >-=head2 borrowernumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Borrower> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "borrowernumber", >- "Koha::Schema::Result::Borrower", >- { borrowernumber => "borrowernumber" }, >- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >-); >- >-=head2 branchcode >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Branch> > >-=cut >- >-__PACKAGE__->belongs_to( >- "branchcode", >- "Koha::Schema::Result::Branch", >- { branchcode => "branchcode" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >-); >- >-=head2 club_holds_to_patron_holds >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold> >- >-=cut >- >-__PACKAGE__->has_many( >- "club_holds_to_patron_holds", >- "Koha::Schema::Result::ClubHoldsToPatronHold", >- { "foreign.hold_id" => "self.reserve_id" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- >-=head2 desk >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Desk> >- >-=cut >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-19 14:50:01 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iAJVTUfqX6QT29xY+QxPnA > >-__PACKAGE__->belongs_to( >- "desk", >- "Koha::Schema::Result::Desk", >- { desk_id => "desk_id" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "SET NULL", >- on_update => "CASCADE", >- }, >-); >- >-=head2 itemnumber >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Item> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "itemnumber", >- "Koha::Schema::Result::Item", >- { itemnumber => "itemnumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >-); >- >-=head2 itemtype >- >-Type: belongs_to >- >-Related object: L<Koha::Schema::Result::Itemtype> >- >-=cut >- >-__PACKAGE__->belongs_to( >- "itemtype", >- "Koha::Schema::Result::Itemtype", >- { itemtype => "itemtype" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >-); >- >- >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BlMb2M0MEmFuTiMSSBEseg >- >-__PACKAGE__->belongs_to( >- "item", >- "Koha::Schema::Result::Item", >- { itemnumber => "itemnumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >-); >- >-__PACKAGE__->belongs_to( >- "biblio", >- "Koha::Schema::Result::Biblio", >- { biblionumber => "biblionumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >-); >- >-__PACKAGE__->belongs_to( >- "patron", >- "Koha::Schema::Result::Borrower", >- { "foreign.borrowernumber" => "self.borrowernumber" }, >- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >-); >- >-__PACKAGE__->add_columns( >- '+item_level_hold' => { is_boolean => 1 }, >- '+lowestPriority' => { is_boolean => 1 }, >- '+suspend' => { is_boolean => 1 }, >- '+non_priority' => { is_boolean => 1 } >-); >- >-sub koha_object_class { >- 'Koha::Hold'; >-} >-sub koha_objects_class { >- 'Koha::Holds'; >-} >- >-__PACKAGE__->belongs_to( >- "itembib", >- "Koha::Schema::Result::Item", >- { biblionumber => "biblionumber" }, >- { >- is_deferrable => 1, >- join_type => "LEFT", >- on_delete => "CASCADE", >- on_update => "CASCADE", >- }, >-); > >+# You can replace this text with custom code or comments, and it will be preserved on regeneration > 1; >-- >2.32.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25260
:
103984
|
103985
|
103986
|
103987
|
103988
|
103989
|
103990
|
103991
|
103992
|
103993
|
104053
|
104054
|
104055
|
104056
|
104057
|
117745
|
117746
|
117747
|
117748
|
117749
|
117750
|
117751
|
122761
|
122762
|
122763
|
122764
|
122765
|
122766
|
122767
|
122787
|
122788
|
122789
|
122790
|
122791
|
122792
|
122793
|
122976
|
122977
|
122978
|
122979
|
122980
|
122981
|
122982
|
122983
|
123071
|
123072
|
123073
|
123074
|
123075
|
123076
|
123077
|
123078
|
123079
|
123080
|
123257
|
123258
|
123259
|
123260
|
123261
|
123396