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

(-)a/installer/data/mysql/atomicupdate/bug_13535_alert_constraint.perl (+11 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    unless ( foreign_key_exists( 'alert', 'alert_ibfk_1' ) ) {
4
        $dbh->do(
5
            qq{
6
            ALTER TABLE alert ADD CONSTRAINT alert_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON UPDATE CASCADE ON DELETE CASCADE
7
              }
8
        );
9
    }
10
    NewVersion( $DBversion, 13535, "Add FK constraint on borrowernumber to alert table");
11
}
(-)a/installer/data/mysql/kohastructure.sql (-2 / +2 lines)
Lines 2830-2836 CREATE TABLE `alert` ( Link Here
2830
  `externalid` varchar(20) NOT NULL default '',
2830
  `externalid` varchar(20) NOT NULL default '',
2831
  PRIMARY KEY  (`alertid`),
2831
  PRIMARY KEY  (`alertid`),
2832
  KEY `borrowernumber` (`borrowernumber`),
2832
  KEY `borrowernumber` (`borrowernumber`),
2833
  KEY `type` (`type`,`externalid`)
2833
  KEY `type` (`type`,`externalid`),
2834
  CONSTRAINT alert_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON UPDATE CASCADE ON DELETE CASCADE
2834
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2835
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2835
2836
2836
--
2837
--
2837
- 

Return to bug 13535