From 67f19d7d02c5bfbd9b92f48c551066373b822c99 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 26 Mar 2019 11:14:55 +0000 Subject: [PATCH] Bug 22577: Retrospectively assign '-1' for cronscripts --- installer/data/mysql/atomicupdate/bug_22577.perl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_22577.perl b/installer/data/mysql/atomicupdate/bug_22577.perl index b0510425a7..bb9672e413 100644 --- a/installer/data/mysql/atomicupdate/bug_22577.perl +++ b/installer/data/mysql/atomicupdate/bug_22577.perl @@ -3,6 +3,10 @@ if( CheckVersion( $DBversion ) ) { $dbh->do( "ALTER TABLE `borrowers` MODIFY COLUMN `branchcode` VARCHAR(10) DEFAULT NULL"); $dbh->do( "ALTER TABLE `borrowers` MODIFY COLUMN `categorycode` VARCHAR(10) DEFAULT NULL"); $dbh->do( "INSERT INTO `borrowers` (borrowernumber, surname, firstname, flags) VALUES ('-1', 'CRON', 'CRON', 0)" ); + $dbh->do( "UPDATE `statistics` SET borrowernumber = '-1' WHERE borrowernumber = '0'" ); + $dbh->do( "UPDATE `statistics` SET borrowernumber = '-1' WHERE borrowernumber = '0'" ); + $dbh->do( "UPDATE `accountlines` SET manager_id = '-1' WHERE manager_id = '0'" ); + $dbh->do( "UPDATE `action_logs` SET user = '-1' WHERE user = '0'" ); SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 22577 - Add internal user for cron)\n"; -- 2.20.1