1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 22:57:14 +02:00

Merge pull request #3697 from SimSync/fix_current_timestamp

fixes e107inc/vstore#99: Difference between MariaDB and MySQL table def
This commit is contained in:
Cameron
2019-03-01 08:47:11 -08:00
committed by GitHub

View File

@@ -152,6 +152,13 @@ class db_verify
$actual['default'] = preg_replace("/DEFAULT '(\d*\.?\d*)'/i", 'DEFAULT $1', $actual['default'] );
}
// Correct difference on CREATE TABLE statement between MariaDB and MySQL
if(1 === preg_match('/(DATE|DATETIME|TIMESTAMP|TIME|YEAR)/i', $expected['default']))
{
$expected['default'] = preg_replace("/CURRENT_TIMESTAMP\(\)/i", 'CURRENT_TIMESTAMP', $expected['default']);
$actual['default'] = preg_replace("/CURRENT_TIMESTAMP\(\)/i", 'CURRENT_TIMESTAMP', $actual['default'] );
}
return array_diff_assoc($expected, $actual);
}