mirror of
https://github.com/e107inc/e107.git
synced 2025-06-04 01:45:15 +02:00
fixes e107org/vstore#99: Difference between MariaDB and MySQL on
command TABLE CREATE returns CURRENT_TIMESTAMP w/o brackets Updated method db_verify::diffStructurePermissive() to correct the given sql table definition.
This commit is contained in:
parent
2c17c4ff9c
commit
dc675c66e4
@ -154,6 +154,13 @@ class db_verify
|
|||||||
$actual['default'] = preg_replace("/DEFAULT '(\d*\.?\d*)'/i", 'DEFAULT $1', $actual['default'] );
|
$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);
|
return array_diff_assoc($expected, $actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user