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

(-)a/installer/data/mysql/atomicupdate/bug_18887.perl (+41 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    $dbh->do(q{
5
        CREATE TABLE `circulation_rules` (
6
          `id` int(11) NOT NULL auto_increment,
7
          `branchcode` varchar(10) NULL default NULL,
8
          `categorycode` varchar(10) NULL default NULL,
9
          `itemtype` varchar(10) NULL default NULL,
10
          `rule_name` varchar(32) NOT NULL,
11
          `rule_value` varchar(32) NOT NULL,
12
          PRIMARY KEY (`id`),
13
          KEY `branchcode` (`branchcode`),
14
          KEY `categorycode` (`categorycode`),
15
          KEY `itemtype` (`itemtype`),
16
          KEY `rule_name` (`rule_name`),
17
          UNIQUE (`branchcode`,`categorycode`,`itemtype`,`rule_name`)
18
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
19
    });
20
21
    $dbh->do(q{
22
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
23
        SELECT branchcode, categorycode, NULL, 'max_holds', max_holds FROM branch_borrower_circ_rules
24
    });
25
26
    $dbh->do(q{
27
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
28
        SELECT NULL, categorycode, NULL, 'max_holds', max_holds FROM branch_borrower_circ_rules
29
    });
30
31
    $dbh->do(q{
32
        ALTER TABLE branch_borrower_circ_rules DROP COLUMN max_holds
33
    });
34
35
    $dbh->do(q{
36
        ALTER TABLE default_borrower_circ_rules DROP COLUMN max_holds
37
    });
38
39
    SetVersion( $DBversion );
40
    print "Upgrade to $DBversion done (Bug 18887 - Introduce new table 'circulation_rules', use for 'max_holds' rules)\n";
41
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +19 lines)
Lines 4192-4197 CREATE TABLE `oauth_access_tokens` ( Link Here
4192
    PRIMARY KEY (`access_token`)
4192
    PRIMARY KEY (`access_token`)
4193
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4193
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4194
4194
4195
--
4196
-- Table structure for table `circulation_rules`
4197
--
4198
4199
DROP TABLE IF EXISTS `circulation_rules`;
4200
CREATE TABLE `circulation_rules` (
4201
  `id` int(11) NOT NULL auto_increment,
4202
  `branchcode` varchar(10) NULL default NULL,
4203
  `categorycode` varchar(10) NULL default NULL,
4204
  `itemtype` varchar(10) NULL default NULL,
4205
  `rule_name` varchar(32) NOT NULL,
4206
  `rule_value` varchar(32) NOT NULL,
4207
  PRIMARY KEY (`id`),
4208
  KEY `branchcode` (`branchcode`),
4209
  KEY `categorycode` (`categorycode`),
4210
  KEY `itemtype` (`itemtype`),
4211
  UNIQUE (`branchcode`,`categorycode`,`itemtype`)
4212
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4213
4195
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4214
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4196
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4215
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4197
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4216
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4198
- 

Return to bug 18887