Bug 27783: (QA follow-up) Make dbrev idempotent

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Tomas Cohen Arazi 2022-04-02 12:58:25 +02:00 committed by Fridolin Somers
parent 9c4a89a7c8
commit db4baee498
1 changed files with 13 additions and 8 deletions

View File

@ -7,14 +7,19 @@ return {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
ALTER TABLE `background_jobs`
ADD `queue` VARCHAR(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default' COMMENT 'Name of the queue the job is sent to' AFTER `type`
});
$dbh->do(q{
ALTER TABLE `background_jobs`
ADD KEY `queue` (`queue`)
});
unless ( column_exists( 'background_jobs', 'queue' ) ) {
$dbh->do(q{
ALTER TABLE `background_jobs`
ADD COLUMN `queue` VARCHAR(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default' COMMENT 'Name of the queue the job is sent to' AFTER `type`
});
}
unless ( index_exists( 'background_jobs', 'queue' ) ) {
$dbh->do(q{
ALTER TABLE `background_jobs`
ADD KEY `queue` (`queue`)
});
}
say $out "Added background_jobs.queue";
},