From e3037d409048d49c4198f8adbc22770d2521c5f5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 25 Feb 2019 13:31:15 -0300 Subject: [PATCH] Bug 22417: UpdateDB entry TODO: - Add the FK on borrowernumber Signed-off-by: Tomas Cohen Arazi --- .../data/mysql/atomicupdate/bug_15032.perl | 25 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 19 ++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_15032.perl diff --git a/installer/data/mysql/atomicupdate/bug_15032.perl b/installer/data/mysql/atomicupdate/bug_15032.perl new file mode 100644 index 0000000000..34554fc2f2 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_15032.perl @@ -0,0 +1,25 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); + + unless ( TableExists('background_jobs') ) { + $dbh->do(q| + CREATE TABLE background_jobs ( + id INT(11) NOT NULL AUTO_INCREMENT, + status VARCHAR(32), + progress INT(11), + size INT(11), + borrowernumber INT(11), + type VARCHAR(64), + data TEXT, + enqueued_on DATETIME DEFAULT NULL, + started_on DATETIME DEFAULT NULL, + ended_on DATETIME DEFAULT NULL, + PRIMARY KEY (id) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + |); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 15032 - Add new table background_jobs)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index cc7c133653..bc885f4f61 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4570,6 +4570,25 @@ CREATE TABLE advanced_editor_macros ( CONSTRAINT borrower_macro_fk FOREIGN KEY ( borrowernumber ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table background_jobs +-- + +DROP TABLE IF EXISTS `background_jobs`; +CREATE TABLE background_jobs ( + id INT(11) NOT NULL AUTO_INCREMENT, + status VARCHAR(32), + progress INT(11), + size INT(11), + borrowernumber INT(11), + type VARCHAR(64), + data TEXT, + enqueued_on DATETIME DEFAULT NULL, + started_on DATETIME DEFAULT NULL, + ended_on DATETIME DEFAULT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -- 2.20.1