Bug 17202: DBRev 20.12.00.042

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-04-28 09:07:26 +00:00
parent 7560fb7e14
commit ebecee43a2
3 changed files with 16 additions and 15 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 = "20.12.00.041";
$VERSION = "20.12.00.042";
sub version {
return $VERSION;

View File

@ -1,14 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
unless( foreign_key_exists( 'collections_tracking', 'collectionst_ibfk_1' ) ) {
$dbh->do(q{
DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections )
});
$dbh->do(q{
ALTER TABLE collections_tracking
ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE
});
}
NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking");
}

View File

@ -24151,6 +24151,21 @@ if ( CheckVersion($DBversion) ) {
NewVersion( $DBversion, 26734, ["Update notices to use defaults", "WARNING - ACCOUNT_DEBIT and ACCOUNT_CREDIT slip templates have been replaced. Backups have been made to the action logs for your reference."] );
}
$DBversion = '20.12.00.042';
if( CheckVersion( $DBversion ) ) {
unless( foreign_key_exists( 'collections_tracking', 'collectionst_ibfk_1' ) ) {
$dbh->do(q{
DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections )
});
$dbh->do(q{
ALTER TABLE collections_tracking
ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE
});
}
NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking");
}
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';