View | Details | Raw Unified | Return to bug 22284
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_22284_add_ft_local_hold_group_to_library_groups.perl (+19 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
    # $dbh->do( "ALTER TABLE library_groups ADD COLUMN ft_local_hold_group tinyint(1) NOT NULL DEFAULT 0 AFTER ft_search_groups_staff" );
5
6
    # or perform some test and warn
7
    if( !column_exists( 'library_groups', 'ft_local_hold_group' ) ) {
8
        $dbh->do( "ALTER TABLE library_groups ADD COLUMN ft_local_hold_group tinyint(1) NOT NULL DEFAULT 0 AFTER ft_search_groups_staff" );
9
    }
10
11
    $dbh->do("ALTER TABLE default_branch_circ_rules MODIFY hold_fulfillment_policy ENUM('any', 'holdgroup', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any'");
12
    $dbh->do("ALTER TABLE default_circ_rules MODIFY hold_fulfillment_policy ENUM('any', 'holdgroup', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any'");
13
    $dbh->do("ALTER TABLE default_branch_item_rules MODIFY hold_fulfillment_policy ENUM('any', 'holdgroup', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any'");
14
    $dbh->do("ALTER TABLE branch_item_rules MODIFY hold_fulfillment_policy ENUM('any', 'holdgroup', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any'");
15
16
    # Always end with this (adjust the bug info)
17
    SetVersion( $DBversion );
18
    print "Upgrade to $DBversion done (Bug 22284 - Add ft_local_hold_group column to library_groups and alter hold_fulfillment_policy in rules tables)\n";
19
}
(-)a/installer/data/mysql/kohastructure.sql (-6 / +6 lines)
Lines 362-368 DROP TABLE IF EXISTS `default_branch_circ_rules`; Link Here
362
CREATE TABLE `default_branch_circ_rules` (
362
CREATE TABLE `default_branch_circ_rules` (
363
  `branchcode` VARCHAR(10) NOT NULL,
363
  `branchcode` VARCHAR(10) NOT NULL,
364
  `holdallowed` tinyint(1) default NULL,
364
  `holdallowed` tinyint(1) default NULL,
365
  hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
365
  hold_fulfillment_policy ENUM('any', 'holdgroup', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
366
  `returnbranch` varchar(15) default NULL,
366
  `returnbranch` varchar(15) default NULL,
367
  PRIMARY KEY (`branchcode`),
367
  PRIMARY KEY (`branchcode`),
368
  CONSTRAINT `default_branch_circ_rules_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
368
  CONSTRAINT `default_branch_circ_rules_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
Lines 377-383 DROP TABLE IF EXISTS `default_circ_rules`; Link Here
377
CREATE TABLE `default_circ_rules` (
377
CREATE TABLE `default_circ_rules` (
378
    `singleton` enum('singleton') NOT NULL default 'singleton',
378
    `singleton` enum('singleton') NOT NULL default 'singleton',
379
    `holdallowed` int(1) default NULL,
379
    `holdallowed` int(1) default NULL,
380
    hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
380
    hold_fulfillment_policy ENUM('any', 'holdgroup', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
381
    `returnbranch` varchar(15) default NULL,
381
    `returnbranch` varchar(15) default NULL,
382
    PRIMARY KEY (`singleton`)
382
    PRIMARY KEY (`singleton`)
383
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
383
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Lines 977-983 DROP TABLE IF EXISTS `default_branch_item_rules`; Link Here
977
CREATE TABLE `default_branch_item_rules` (
977
CREATE TABLE `default_branch_item_rules` (
978
  `itemtype` varchar(10) NOT NULL,
978
  `itemtype` varchar(10) NOT NULL,
979
  `holdallowed` tinyint(1) default NULL,
979
  `holdallowed` tinyint(1) default NULL,
980
  hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
980
  hold_fulfillment_policy ENUM('any', 'holdgroup', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
981
  `returnbranch` varchar(15) default NULL,
981
  `returnbranch` varchar(15) default NULL,
982
  PRIMARY KEY  (`itemtype`),
982
  PRIMARY KEY  (`itemtype`),
983
  CONSTRAINT `default_branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
983
  CONSTRAINT `default_branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
Lines 1015-1021 CREATE TABLE `branch_item_rules` ( -- information entered in the circulation and Link Here
1015
  `branchcode` varchar(10) NOT NULL, -- the branch this rule is for (branches.branchcode)
1015
  `branchcode` varchar(10) NOT NULL, -- the branch this rule is for (branches.branchcode)
1016
  `itemtype` varchar(10) NOT NULL, -- the item type this rule applies to (items.itype)
1016
  `itemtype` varchar(10) NOT NULL, -- the item type this rule applies to (items.itype)
1017
  `holdallowed` tinyint(1) default NULL, -- the number of holds allowed
1017
  `holdallowed` tinyint(1) default NULL, -- the number of holds allowed
1018
  hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
1018
  hold_fulfillment_policy ENUM('any', 'holdgroup', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
1019
  `returnbranch` varchar(15) default NULL, -- the branch the item returns to (homebranch, holdingbranch, noreturn)
1019
  `returnbranch` varchar(15) default NULL, -- the branch the item returns to (homebranch, holdingbranch, noreturn)
1020
  PRIMARY KEY  (`itemtype`,`branchcode`),
1020
  PRIMARY KEY  (`itemtype`,`branchcode`),
1021
  KEY `branch_item_rules_ibfk_2` (`branchcode`),
1021
  KEY `branch_item_rules_ibfk_2` (`branchcode`),
Lines 4207-4213 CREATE TABLE library_groups ( Link Here
4207
    description MEDIUMTEXT NULL DEFAULT NULL,    -- Longer explanation of the group, if necessary
4207
    description MEDIUMTEXT NULL DEFAULT NULL,    -- Longer explanation of the group, if necessary
4208
    ft_hide_patron_info tinyint(1) NOT NULL DEFAULT 0, -- Turn on the feature "Hide patron's info" for this group
4208
    ft_hide_patron_info tinyint(1) NOT NULL DEFAULT 0, -- Turn on the feature "Hide patron's info" for this group
4209
    ft_search_groups_opac tinyint(1) NOT NULL DEFAULT 0, -- Use this group for staff side search groups
4209
    ft_search_groups_opac tinyint(1) NOT NULL DEFAULT 0, -- Use this group for staff side search groups
4210
     ft_search_groups_staff tinyint(1) NOT NULL DEFAULT 0, -- Use this group for opac side search groups
4210
    ft_search_groups_staff tinyint(1) NOT NULL DEFAULT 0, -- Use this group for opac side search groups
4211
    ft_local_hold_group tinyint(1) NOT NULL DEFAULT 0, -- Use this group to identify libraries as pick up location for holds
4211
    created_on TIMESTAMP NULL,             -- Date and time of creation
4212
    created_on TIMESTAMP NULL,             -- Date and time of creation
4212
    updated_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Date and time of last
4213
    updated_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Date and time of last
4213
    PRIMARY KEY id ( id ),
4214
    PRIMARY KEY id ( id ),
4214
- 

Return to bug 22284