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

(-)a/installer/data/mysql/atomicupdate/bug_XXXXX.perl (+18 lines)
Lines 53-58 if( CheckVersion( $DBversion ) ) { Link Here
53
        ('PseudonymizationTransactionFields','','datetime,branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the anonymized_transactions table','multiple'),
53
        ('PseudonymizationTransactionFields','','datetime,branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the anonymized_transactions table','multiple'),
54
    |);
54
    |);
55
55
56
    unless( TableExists( 'anonymized_borrower_attributes' ) ) {
57
        $dbh->do(q|
58
            DROP TABLE IF EXISTS `borrower_attributes`;
59
            CREATE TABLE `borrower_attributes` (
60
              `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
61
              `borrowernumber` int(11) NOT NULL,
62
              `code` varchar(10) NOT NULL,
63
              `attribute` varchar(255) default NULL,
64
              KEY `borrowernumber` (`borrowernumber`),
65
              KEY `code_attribute` (`code`, `attribute` (191)),
66
              CONSTRAINT `borrower_attributes_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
67
                ON DELETE CASCADE ON UPDATE CASCADE,
68
              CONSTRAINT `borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`)
69
                ON DELETE CASCADE ON UPDATE CASCADE
70
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
71
        |);
72
    }
73
56
    # Always end with this (adjust the bug info)
74
    # Always end with this (adjust the bug info)
57
    SetVersion( $DBversion );
75
    SetVersion( $DBversion );
58
    print "Upgrade to $DBversion done (Bug XXXXX - description)\n";
76
    print "Upgrade to $DBversion done (Bug XXXXX - description)\n";
(-)a/installer/data/mysql/kohastructure.sql (-1 / +17 lines)
Lines 4489-4494 CREATE TABLE return_claims ( Link Here
4489
    CONSTRAINT `rc_resolved_by_ibfk` FOREIGN KEY (`resolved_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
4489
    CONSTRAINT `rc_resolved_by_ibfk` FOREIGN KEY (`resolved_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
4490
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4490
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4491
4491
4492
--
4493
-- Table structure for table borrower_attributes
4494
--
4495
4496
DROP TABLE IF EXISTS anonymized_borrower_attributes;
4497
CREATE TABLE anonymized_borrower_attributes( -- association table between anonymized_borrowers and borrower_attributes
4498
  `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, -- Row id field
4499
  `hashed_borrowernumber` VARCHAR(60) NOT NULL, -- foreign key from the anonymized_borrowers table, defines which anonymized patron has this attribute
4500
  `code` varchar(10) NOT NULL, -- foreign key from the borrower_attribute_types table, defines which custom field this value was entered for
4501
  `attribute` varchar(255) default NULL, -- custom patron field value
4502
  KEY `hashed_borrowernumber` (`hashed_borrowernumber`),
4503
  CONSTRAINT `anonymized_borrower_attributes_ibfk_1` FOREIGN KEY (`hashed_borrowernumber`) REFERENCES `anonymized_borrowers` (`hashed_borrowernumber`)
4504
    ON DELETE CASCADE ON UPDATE CASCADE,
4505
  CONSTRAINT `anonymized_borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`)
4506
    ON DELETE CASCADE ON UPDATE CASCADE
4507
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4508
4492
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4509
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4493
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4510
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4494
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4511
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4495
- 

Return to bug 24151