Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Invalid
-
Labels:None
Description
The migration diff command always thinks that my model definitions have changed, when I use the manual columnDefinition on a timestamp column:
dateUpdated:
type: datetime
columnDefinition: TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
This always results in a migration script like this:
<?php
namespace SuplifyApiMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class Version20101028121948 extends AbstractMigration
{
public function up(Schema $schema)
{
$this->_addSql('ALTER TABLE ticket CHANGE dateUpdated dateUpdated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL');
}
public function down(Schema $schema)
{
$this->_addSql('ALTER TABLE ticket CHANGE dateUpdated dateUpdated DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
}
}
As you can see, the columns look exactly the same. Doctrine just does not seem to parse the manual columnDefinition and compare its result.
Its not possible to fix this issue, its actually a drawback of using "columnDefinition", i started documenting this in the ORM docs.