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:
parent
a6a77c89cd
commit
88133aaec5
|
|
@ -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!" );
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
@ -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 */;
|
||||
|
|
|
|||
Loading…
Reference in New Issue