Bugzilla – Attachment 103537 Details for
Bug 25089
Add checkout_type to circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25089: Add a new checkout_type to circulation_rules table
Bug-25089-Add-a-new-checkouttype-to-circulationrul.patch (text/plain), 3.29 KB, created by
Lari Taskula
on 2020-04-23 06:41:53 UTC
(
hide
)
Description:
Bug 25089: Add a new checkout_type to circulation_rules table
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2020-04-23 06:41:53 UTC
Size:
3.29 KB
patch
obsolete
>From ea544935d9d81191e0ec59bcdc110cabd095229f 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 25089: Add a new checkout_type 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_25089_1_add_checkout_type_to_circulation_rules.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_25089_1_add_checkout_type_to_circulation_rules.perl b/installer/data/mysql/atomicupdate/bug_25089_1_add_checkout_type_to_circulation_rules.perl >new file mode 100644 >index 0000000000..75716cdece >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_25089_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', 'checkout_type' ) ) { >+ $dbh->do( q| >+ ALTER TABLE circulation_rules ADD COLUMN checkout_type ENUM('CHECKOUT', 'ONSITE') DEFAULT NULL AFTER itemtype; >+ | ); >+ >+ 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`;" ); >+ $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`,`categorycode`,`itemtype`,`checkout_type`,`rule_name`)" ); >+ } >+ } >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 25089 - Add new circulation rule scope checkout_type )\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index c52e349934..12da2ad7f9 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4317,6 +4317,7 @@ CREATE TABLE `circulation_rules` ( > `branchcode` varchar(10) NULL default NULL, > `categorycode` varchar(10) NULL default NULL, > `itemtype` varchar(10) NULL default NULL, >+ `checkout_type` ENUM('CHECKOUT', 'ONSITE') NULL default NULL, > `rule_name` varchar(32) NOT NULL, > `rule_value` varchar(32) NOT NULL, > PRIMARY KEY (`id`), >@@ -4324,7 +4325,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`,`categorycode`,`itemtype`,`checkout_type`,`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 25089
:
103046
|
103047
|
103048
|
103049
|
103050
|
103051
|
103052
|
103053
|
103054
|
103239
|
103240
|
103241
|
103242
|
103243
|
103244
|
103245
|
103246
|
103247
|
103248
|
103283
|
103284
|
103285
|
103286
|
103287
|
103288
|
103289
|
103290
|
103291
|
103292
|
103339
|
103340
|
103341
|
103342
|
103343
|
103344
|
103345
|
103346
|
103347
|
103348
|
103349
|
103351
|
103352
|
103353
|
103354
|
103355
|
103356
|
103357
|
103358
|
103359
|
103360
|
103361
|
103537
|
103538
|
103539
|
103540
|
103541
|
103542
|
103543
|
103544
|
103545
|
103546
|
103547
|
104274
|
104275
|
107523
|
107524
|
107525
|
107526
|
107527
|
107528
|
107529
|
107530
|
107531
|
107532
|
107533