[DMIG-11] Comparer always detects changes when using columnDefinition in mapping definitions Created: 28/Oct/10  Updated: 15/Feb/11  Resolved: 15/Feb/11

Status: Resolved
Project: Doctrine Migrations
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Sebastian Hoitz Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


The migration diff command always thinks that my model definitions have changed, when I use the manual columnDefinition on a timestamp column:

      type: datetime

This always results in a migration script like this:


namespace SuplifyApiMigrations;

use Doctrine\DBAL\Migrations\AbstractMigration,

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.

Comment by Benjamin Eberlei [ 15/Feb/11 ]

Its not possible to fix this issue, its actually a drawback of using "columnDefinition", i started documenting this in the ORM docs.

Generated at Fri Oct 09 10:14:32 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.