Bug 23081: atomicupdate for change to existing installs

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Andrew Fuerste-Henry 2020-04-26 23:53:26 +00:00 committed by Martin Renvoize
parent ec1bfd2b74
commit e116f744a0
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
# you can use $dbh here like:
$dbh->do( "UPDATE items set issues=0 where issues is null" );
$dbh->do( "UPDATE deleteditems set issues=0 where issues is null" );
$dbh->do( "ALTER TABLE items ALTER issues set default 0" );
$dbh->do( "ALTER TABLE deleteditems ALTER issues set default 0" );
# or perform some test and warn
# if( !column_exists( 'biblio', 'biblionumber' ) ) {
# warn "There is something wrong";
# }
# Always end with this (adjust the bug info)
NewVersion( $DBversion, 23081, "Set default to 0 for items.issues");
}