@@ -, +, @@ collections_tracking --- .../mysql/atomicupdate/rotatingCollections.perl | 7 +++++ installer/data/mysql/kohastructure.sql | 30 +++++++++++++--------- 2 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/rotatingCollections.perl --- a/installer/data/mysql/atomicupdate/rotatingCollections.perl +++ a/installer/data/mysql/atomicupdate/rotatingCollections.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE collections_tracking ADD CONSTRAINT collections_tracking_ibfk_1 FOREIGN KEY (colId) REFERENCES collections (colId) ON DELETE CASCADE ON UPDATE CASCADE" ); $dbh->do( "ALTER TABLE collections_tracking ADD CONSTRAINT collections_tracking_ibfk_2 FOREIGN KEY (itemnumber) REFERENCES items (itemnumber) ON DELETE CASCADE ON UPDATE CASCADE" ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug XXXXX - Rotating collections objects)\n"; +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -328,18 +328,6 @@ ALTER TABLE `collections` ADD CONSTRAINT `collections_ibfk_1` FOREIGN KEY (`colBranchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE; -- --- Table: collections_tracking --- - -DROP TABLE IF EXISTS collections_tracking; -CREATE TABLE collections_tracking ( - collections_tracking_id integer(11) NOT NULL auto_increment, - colId integer(11) NOT NULL DEFAULT 0 comment 'collections.colId', - itemnumber integer(11) NOT NULL DEFAULT 0 comment 'items.itemnumber', - PRIMARY KEY (collections_tracking_id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- -- Table structure for table `branch_borrower_circ_rules` -- @@ -970,6 +958,24 @@ CREATE TABLE `itemtypes` ( -- defines the item types ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- +-- Table: collections_tracking +-- + +DROP TABLE IF EXISTS collections_tracking; +CREATE TABLE collections_tracking ( + collections_tracking_id integer(11) NOT NULL auto_increment, + colId integer(11) NOT NULL DEFAULT 0 comment 'collections.colId', + itemnumber integer(11) NOT NULL DEFAULT 0 comment 'items.itemnumber', + PRIMARY KEY (collections_tracking_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +ALTER TABLE `collections_tracking` + ADD CONSTRAINT `collections_tracking_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE; + +ALTER TABLE `collections_tracking` + ADD CONSTRAINT `collections_tracking_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- -- Table structure for table `default_branch_item_rules` -- --