[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


 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.



 Comments   
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 Thu Oct 02 15:04:39 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.