@@ -, +, @@ --- installer/data/mysql/atomicupdate/bug_21682.perl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/installer/data/mysql/atomicupdate/bug_21682.perl +++ a/installer/data/mysql/atomicupdate/bug_21682.perl @@ -1,6 +1,10 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - $dbh->do( "ALTER TABLE `stockrotationrotas` ALTER COLUMN `description` DROP DEFAULT" ); + # people upgrading their MySQL/MariaDB will have already had the DB forcibly fixed, + # but for those who have not, and there is a sql strict mode issue, this will fix it. + if ( default_exists( 'stockrotationrotas', 'description' ) ) { + $dbh->do( "ALTER TABLE `stockrotationrotas` ALTER COLUMN `description` DROP DEFAULT" ); + } SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 21682 - Remove default on stockrotationrotas.description )\n"; --