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

(-)a/installer/data/mysql/atomicupdate/bug_17202.perl (+12 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections )
5
    });
6
    $dbh->do(q{
7
        ALTER TABLE collections_tracking
8
        ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE
9
    });
10
11
    NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking");
12
}
(-)a/installer/data/mysql/kohastructure.sql (-2 / +2 lines)
Lines 1980-1986 CREATE TABLE `collections_tracking` ( Link Here
1980
  `collections_tracking_id` int(11) NOT NULL AUTO_INCREMENT,
1980
  `collections_tracking_id` int(11) NOT NULL AUTO_INCREMENT,
1981
  `colId` int(11) NOT NULL DEFAULT 0 COMMENT 'collections.colId',
1981
  `colId` int(11) NOT NULL DEFAULT 0 COMMENT 'collections.colId',
1982
  `itemnumber` int(11) NOT NULL DEFAULT 0 COMMENT 'items.itemnumber',
1982
  `itemnumber` int(11) NOT NULL DEFAULT 0 COMMENT 'items.itemnumber',
1983
  PRIMARY KEY (`collections_tracking_id`)
1983
  PRIMARY KEY (`collections_tracking_id`),
1984
  CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE
1984
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1985
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1985
/*!40101 SET character_set_client = @saved_cs_client */;
1986
/*!40101 SET character_set_client = @saved_cs_client */;
1986
1987
1987
- 

Return to bug 17202