Bug 22417: UpdateDB entry

TODO:
- Add the FK on borrowernumber

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2019-02-25 13:31:15 -03:00
parent ab2760e7e4
commit df1b8db174
2 changed files with 44 additions and 0 deletions

View file

@ -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";
}

View file

@ -4630,6 +4630,25 @@ CREATE TABLE `library_smtp_servers` (
CONSTRAINT `library_smtp_servers_smtp_servers_fk` FOREIGN KEY (`smtp_server_id`) REFERENCES `smtp_servers` (`id`) ON DELETE CASCADE ON UPDATE 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 */;