@@ -, +, @@ --- .../data/mysql/atomicupdate/bug_30182.pl | 27 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_30182.pl --- a/installer/data/mysql/atomicupdate/bug_30182.pl +++ a/installer/data/mysql/atomicupdate/bug_30182.pl @@ -0,0 +1,27 @@ +use Modern::Perl; + +return { + bug_number => "30182", + description => "Make background_jobs.status an ENUM", + up => sub { + my ($args) = @_; + my $dbh = $args->{dbh}; + + $dbh->do( + q{ + ALTER TABLE + `background_jobs` + MODIFY COLUMN + `status` ENUM( + 'new', + 'started', + 'finished', + 'cancelled' + ) COLLATE utf8mb4_unicode_ci + NOT NULL + DEFAULT 'new' + COMMENT 'Job status' + } + ); + }, +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -976,7 +976,7 @@ DROP TABLE IF EXISTS `background_jobs`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `background_jobs` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `status` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `status` ENUM('new','started','finished','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'new' COMMENT 'Job status', `progress` int(11) DEFAULT NULL, `size` int(11) DEFAULT NULL, `borrowernumber` int(11) DEFAULT NULL, --