[2.0] Fixes issue with optimistic timestamp locking (closes #2451)
This commit is contained in:
parent
8f75565277
commit
adbfbf5417
@ -264,7 +264,11 @@ class MySqlPlatform extends AbstractPlatform
|
||||
*/
|
||||
public function getDateTimeTypeDeclarationSql(array $fieldDeclaration)
|
||||
{
|
||||
return 'DATETIME';
|
||||
if ($fieldDeclaration['version']) {
|
||||
return 'TIMESTAMP';
|
||||
} else {
|
||||
return 'DATETIME';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -249,6 +249,7 @@ class SchemaTool
|
||||
$column['length'] = isset($mapping['length']) ? $mapping['length'] : null;
|
||||
$column['notnull'] = isset($mapping['nullable']) ? ! $mapping['nullable'] : false;
|
||||
$column['unique'] = isset($mapping['unique']) ? $mapping['unique'] : false;
|
||||
$column['version'] = $class->isVersioned && $class->versionField == $mapping['fieldName'] ? true : false;
|
||||
|
||||
if (isset($mapping['precision'])) {
|
||||
$column['precision'] = $mapping['precision'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user