Bug 29393: (QA follow-up) Make database update idempotent

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-04-25 09:58:19 +01:00 committed by Katrin Fischer
parent edefd14f23
commit 270ff5cd1d
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 8 additions and 6 deletions

View File

@ -1,14 +1,16 @@
use Modern::Perl;
return {
bug_number => "29393",
bug_number => "29393",
description => "Add permission borrowers:send_messages_to_borrowers",
up => sub {
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
my ( $dbh, $out ) = @$args{qw(dbh out)};
$dbh->do(q{INSERT INTO permissions (module_bit, code, description)
VALUES (4, 'send_messages_to_borrowers', 'Send messages to patrons')});
$dbh->do(
q{INSERT IGNORE INTO permissions (module_bit, code, description)
VALUES (4, 'send_messages_to_borrowers', 'Send messages to patrons')}
);
say $out "Update is going well so far";
},
}
}