Bugzilla – Attachment 114417 Details for
Bug 26814
Add onsite_checkout to circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26814: Add a new column onsite_checkout to circulation_rules table
Bug-26814-Add-a-new-column-onsitecheckout-to-circu.patch (text/plain), 3.36 KB, created by
Lari Taskula
on 2020-12-15 23:31:23 UTC
(
hide
)
Description:
Bug 26814: Add a new column onsite_checkout to circulation_rules table
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2020-12-15 23:31:23 UTC
Size:
3.36 KB
patch
obsolete
>From 880e18f10c574a41460d511f9089957b49a7ce63 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Tue, 31 Mar 2020 16:24:53 +0000 >Subject: [PATCH] Bug 26814: Add a new column onsite_checkout to > circulation_rules table > >To add: >1. perl installer/data/mysql/updatedatabase.pl > >Sponsored-by: The National Library of Finland >--- > ...dd_checkout_type_to_circulation_rules.perl | 21 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 3 ++- > 2 files changed, 23 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_26814_1_add_checkout_type_to_circulation_rules.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_26814_1_add_checkout_type_to_circulation_rules.perl b/installer/data/mysql/atomicupdate/bug_26814_1_add_checkout_type_to_circulation_rules.perl >new file mode 100644 >index 0000000000..b7e3225ea3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_26814_1_add_checkout_type_to_circulation_rules.perl >@@ -0,0 +1,21 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ if ( ! column_exists( 'circulation_rules', 'onsite_checkout' ) ) { >+ $dbh->do( q| >+ ALTER TABLE circulation_rules ADD COLUMN onsite_checkout INT(1) DEFAULT NULL AFTER branchcode; >+ | ); >+ >+ if ( index_exists( 'circulation_rules', 'branchcode' ) ) { >+ # we need to drop this forgein key before updating our unique index >+ $dbh->do( "ALTER TABLE `circulation_rules` DROP FOREIGN KEY circ_rules_ibfk_1;" ); >+ $dbh->do( "ALTER TABLE `circulation_rules` DROP INDEX `branchcode`;" ); # index columns: branchcode, categorycode, itemtype and rule_name >+ $dbh->do( "ALTER TABLE `circulation_rules` ADD CONSTRAINT circ_rules_ibfk_1 FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE" ); >+ $dbh->do( "ALTER TABLE `circulation_rules` ADD UNIQUE INDEX (`branchcode`,`onsite_checkout`,`categorycode`,`itemtype`,`rule_name`)" ); >+ } >+ } >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 26814 - Add new circulation rule scope onsite_checkout )\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index ef3bff04b0..33ff955b72 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4468,6 +4468,7 @@ DROP TABLE IF EXISTS `circulation_rules`; > CREATE TABLE `circulation_rules` ( > `id` int(11) NOT NULL auto_increment, > `branchcode` varchar(10) NULL default NULL, >+ `onsite_checkout` int(1) NULL default NULL, > `categorycode` varchar(10) NULL default NULL, > `itemtype` varchar(10) NULL default NULL, > `rule_name` varchar(32) NOT NULL, >@@ -4477,7 +4478,7 @@ CREATE TABLE `circulation_rules` ( > CONSTRAINT `circ_rules_ibfk_2` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE, > CONSTRAINT `circ_rules_ibfk_3` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE, > KEY `rule_name` (`rule_name`), >- UNIQUE (`branchcode`,`categorycode`,`itemtype`,`rule_name`) >+ UNIQUE (`branchcode`,`onsite_checkout`,`categorycode`,`itemtype`,`rule_name`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > > -- >-- >2.17.1
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 26814
:
112376
|
112377
|
112378
|
112379
|
112380
|
112381
|
112382
|
112383
|
112384
|
112385
|
112608
|
112609
|
112610
|
112611
|
112623
|
112624
|
112625
|
112626
|
112627
|
112628
|
112630
|
112631
|
112632
|
112651
|
112652
|
112653
| 114417 |
114418
|
114419
|
114420
|
114421
|
114422
|
114423
|
114424
|
114425
|
114426
|
114427