From e493cca4a0cba37894b5327d4cc8776e2e0148db Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 27 Nov 2019 15:52:57 +0000 Subject: [PATCH] Bug 24130: (RM follow-up) Fix old invalid data Signed-off-by: Martin Renvoize --- installer/data/mysql/updatedatabase.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 232e180275..fb3b4c223b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -17632,6 +17632,17 @@ if( CheckVersion( $DBversion ) ) { $DBversion = '18.12.00.024'; if ( CheckVersion($DBversion) ) { + # Fixup any pre-existing bad suggestedby, manageddate, accepteddate dates + $dbh->do( + "UPDATE suggestions SET suggesteddate = '1970-01-01' WHERE suggesteddate = '0000-00-00';" + ); + $dbh->do( + "UPDATE suggestions SET manageddate = '1970-01-01' WHERE manageddate = '0000-00-00';" + ); + $dbh->do( + "UPDATE suggestions SET accepteddate = '1970-01-01' WHERE accepteddate = '0000-00-00';" + ); + # Add constraint for suggestedby unless ( foreign_key_exists( 'suggestions', 'suggestions_ibfk_suggestedby' ) ) { -- 2.39.5