Bug 37511: DB changes

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
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:
Janusz Kaczmarek 2024-10-01 10:36:30 +00:00 committed by Katrin Fischer
parent a6a77c89cd
commit 88133aaec5
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
use Try::Tiny;
return {
bug_number => "37511",
description => "Add a new column p_cs_precedes to the table currency",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
if ( !column_exists( 'currency', 'p_cs_precedes' ) ) {
try {
$dbh->do(
q{
ALTER TABLE `currency` ADD COLUMN `p_cs_precedes` tinyint(1) DEFAULT 1
}
);
say_success( $out, "Added column p_cs_precedes" );
} catch {
say_failure(
$out,
"Adding column 'currency.p_cs_precedes' failed with errors: $_"
);
};
} else {
say_info( $out, "Column 'currency.p_cs_precedes' already exists!" );
}
},
};

View File

@ -2538,6 +2538,7 @@ CREATE TABLE `currency` (
`active` tinyint(1) DEFAULT NULL,
`archived` tinyint(1) DEFAULT 0,
`p_sep_by_space` tinyint(1) DEFAULT 0,
`p_cs_precedes` tinyint(1) DEFAULT 1,
PRIMARY KEY (`currency`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;