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

(-)a/installer/data/mysql/atomicupdate/bug_18887.perl (-16 / +18 lines)
Lines 1-22 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
3
4
    $dbh->do(q{
4
    unless (TableExists('circulation_rules')){
5
        CREATE TABLE `circulation_rules` (
5
        $dbh->do(q{
6
          `id` int(11) NOT NULL auto_increment,
6
            CREATE TABLE `circulation_rules` (
7
          `branchcode` varchar(10) NULL default NULL,
7
              `id` int(11) NOT NULL auto_increment,
8
          `categorycode` varchar(10) NULL default NULL,
8
              `branchcode` varchar(10) NULL default NULL,
9
          `itemtype` varchar(10) NULL default NULL,
9
              `categorycode` varchar(10) NULL default NULL,
10
          `rule_name` varchar(32) NOT NULL,
10
              `itemtype` varchar(10) NULL default NULL,
11
          `rule_value` varchar(32) NOT NULL,
11
              `rule_name` varchar(32) NOT NULL,
12
          PRIMARY KEY (`id`),
12
              `rule_value` varchar(32) NOT NULL,
13
          KEY `branchcode` (`branchcode`),
13
              PRIMARY KEY (`id`),
14
          KEY `categorycode` (`categorycode`),
14
              KEY `branchcode` (`branchcode`),
15
          KEY `itemtype` (`itemtype`),
15
              KEY `categorycode` (`categorycode`),
16
          KEY `rule_name` (`rule_name`),
16
              KEY `itemtype` (`itemtype`),
17
          UNIQUE (`branchcode`,`categorycode`,`itemtype`,`rule_name`)
17
              KEY `rule_name` (`rule_name`),
18
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
18
              UNIQUE (`branchcode`,`categorycode`,`itemtype`,`rule_name`)
19
    });
19
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
20
        });
21
    }
20
22
21
    $dbh->do(q{
23
    $dbh->do(q{
22
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
24
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
(-)a/installer/data/mysql/kohastructure.sql (-5 / +3 lines)
Lines 350-356 CREATE TABLE `branch_borrower_circ_rules` ( -- includes default circulation rule Link Here
350
  `categorycode` VARCHAR(10) NOT NULL, -- the patron category this rule applies to (categories.categorycode)
350
  `categorycode` VARCHAR(10) NOT NULL, -- the patron category this rule applies to (categories.categorycode)
351
  `maxissueqty` int(4) default NULL, -- the maximum number of checkouts this patron category can have at this branch
351
  `maxissueqty` int(4) default NULL, -- the maximum number of checkouts this patron category can have at this branch
352
  `maxonsiteissueqty` int(4) default NULL, -- the maximum number of on-site checkouts this patron category can have at this branch
352
  `maxonsiteissueqty` int(4) default NULL, -- the maximum number of on-site checkouts this patron category can have at this branch
353
  max_holds INT(4) NULL DEFAULT NULL, -- the maximum number of holds a patron may have at a time
354
  PRIMARY KEY (`categorycode`, `branchcode`),
353
  PRIMARY KEY (`categorycode`, `branchcode`),
355
  CONSTRAINT `branch_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
354
  CONSTRAINT `branch_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
356
    ON DELETE CASCADE ON UPDATE CASCADE,
355
    ON DELETE CASCADE ON UPDATE CASCADE,
Lines 367-373 CREATE TABLE `default_borrower_circ_rules` ( -- default checkout rules found und Link Here
367
  `categorycode` VARCHAR(10) NOT NULL, -- patron category this rul
366
  `categorycode` VARCHAR(10) NOT NULL, -- patron category this rul
368
  `maxissueqty` int(4) default NULL,
367
  `maxissueqty` int(4) default NULL,
369
  `maxonsiteissueqty` int(4) default NULL,
368
  `maxonsiteissueqty` int(4) default NULL,
370
  max_holds INT(4) NULL DEFAULT NULL, -- the maximum number of holds a patron may have at a time
371
  PRIMARY KEY (`categorycode`),
369
  PRIMARY KEY (`categorycode`),
372
  CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
370
  CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
373
    ON DELETE CASCADE ON UPDATE CASCADE
371
    ON DELETE CASCADE ON UPDATE CASCADE
Lines 4224-4231 CREATE TABLE `circulation_rules` ( Link Here
4224
  KEY `branchcode` (`branchcode`),
4222
  KEY `branchcode` (`branchcode`),
4225
  KEY `categorycode` (`categorycode`),
4223
  KEY `categorycode` (`categorycode`),
4226
  KEY `itemtype` (`itemtype`),
4224
  KEY `itemtype` (`itemtype`),
4227
  UNIQUE (`branchcode`,`categorycode`,`itemtype`)
4225
  KEY `rule_name` (`rule_name`),
4228
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4226
  UNIQUE (`branchcode`,`categorycode`,`itemtype`,`rule_name`)
4227
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4229
4228
4230
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4229
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4231
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4230
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4232
- 

Return to bug 18887