1
0
mirror of synced 2025-02-20 06:03:15 +03:00

[2.0] Fixes issue with optimistic timestamp locking (closes #2451)

This commit is contained in:
jwage 2009-09-08 17:09:32 +00:00
parent 8f75565277
commit adbfbf5417
2 changed files with 6 additions and 1 deletions

View File

@ -264,7 +264,11 @@ class MySqlPlatform extends AbstractPlatform
*/
public function getDateTimeTypeDeclarationSql(array $fieldDeclaration)
{
return 'DATETIME';
if ($fieldDeclaration['version']) {
return 'TIMESTAMP';
} else {
return 'DATETIME';
}
}
/**

View File

@ -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'];