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 349-355 CREATE TABLE `branch_borrower_circ_rules` ( -- includes default circulation rule Link Here
349
  `categorycode` VARCHAR(10) NOT NULL, -- the patron category this rule applies to (categories.categorycode)
349
  `categorycode` VARCHAR(10) NOT NULL, -- the patron category this rule applies to (categories.categorycode)
350
  `maxissueqty` int(4) default NULL, -- the maximum number of checkouts this patron category can have at this branch
350
  `maxissueqty` int(4) default NULL, -- the maximum number of checkouts this patron category can have at this branch
351
  `maxonsiteissueqty` int(4) default NULL, -- the maximum number of on-site checkouts this patron category can have at this branch
351
  `maxonsiteissueqty` int(4) default NULL, -- the maximum number of on-site checkouts this patron category can have at this branch
352
  max_holds INT(4) NULL DEFAULT NULL, -- the maximum number of holds a patron may have at a time
353
  PRIMARY KEY (`categorycode`, `branchcode`),
352
  PRIMARY KEY (`categorycode`, `branchcode`),
354
  CONSTRAINT `branch_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
353
  CONSTRAINT `branch_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
355
    ON DELETE CASCADE ON UPDATE CASCADE,
354
    ON DELETE CASCADE ON UPDATE CASCADE,
Lines 366-372 CREATE TABLE `default_borrower_circ_rules` ( -- default checkout rules found und Link Here
366
  `categorycode` VARCHAR(10) NOT NULL, -- patron category this rul
365
  `categorycode` VARCHAR(10) NOT NULL, -- patron category this rul
367
  `maxissueqty` int(4) default NULL,
366
  `maxissueqty` int(4) default NULL,
368
  `maxonsiteissueqty` int(4) default NULL,
367
  `maxonsiteissueqty` int(4) default NULL,
369
  max_holds INT(4) NULL DEFAULT NULL, -- the maximum number of holds a patron may have at a time
370
  PRIMARY KEY (`categorycode`),
368
  PRIMARY KEY (`categorycode`),
371
  CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
369
  CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
372
    ON DELETE CASCADE ON UPDATE CASCADE
370
    ON DELETE CASCADE ON UPDATE CASCADE
Lines 4235-4242 CREATE TABLE `circulation_rules` ( Link Here
4235
  KEY `branchcode` (`branchcode`),
4233
  KEY `branchcode` (`branchcode`),
4236
  KEY `categorycode` (`categorycode`),
4234
  KEY `categorycode` (`categorycode`),
4237
  KEY `itemtype` (`itemtype`),
4235
  KEY `itemtype` (`itemtype`),
4238
  UNIQUE (`branchcode`,`categorycode`,`itemtype`)
4236
  KEY `rule_name` (`rule_name`),
4239
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4237
  UNIQUE (`branchcode`,`categorycode`,`itemtype`,`rule_name`)
4238
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4240
4239
4241
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4240
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4242
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4241
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4243
- 

Return to bug 18887