Bug 12446: DBRev 22.06.00.004

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomas Cohen Arazi 2022-06-23 12:00:36 -03:00
parent d78c0e4730
commit d1fbd8b3c6
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
3 changed files with 24 additions and 11 deletions

View File

@ -29,7 +29,7 @@ use vars qw{ $VERSION };
# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
$VERSION = "22.06.00.003";
$VERSION = "22.06.00.004";
sub version {
return $VERSION;

View File

@ -1,10 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
if ( !column_exists( 'categories', 'canbeguarantee') ){
$dbh->do("ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0' AFTER `checkprevcheckout`");
$dbh->do("UPDATE categories SET canbeguarantee = 1 WHERE category_type = 'P' OR category_type = 'C'");
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 12446 - Ability to allow guarantor relationship for all patron category types)\n";
}

View File

@ -0,0 +1,23 @@
use Modern::Perl;
return {
bug_number => "12446",
description => "Ability to allow guarantor relationship for all patron category types",
up => sub {
my ($args) = @_;
my ($dbh) = @$args{qw(dbh)};
unless ( column_exists( 'categories', 'canbeguarantee' ) ) {
$dbh->do(q{
ALTER TABLE categories
ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0' AFTER `checkprevcheckout`
});
}
$dbh->do(q{
UPDATE categories
SET canbeguarantee = 1
WHERE category_type = 'P' OR category_type = 'C'
});
},
};