[DMIG-17] bug in reverting migrations Created: 15/Jan/11  Updated: 16/Nov/11

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

Type: Bug Priority: Major
Reporter: Stepan Tanasiychuk Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 4
Labels: None

Linux stfalcon-laptop 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC 2010 x86_64 GNU/Linux
Installed packages, channel pear.doctrine-project.org:
Package Version State
DoctrineCommon 2.0.0 stable
DoctrineDBAL 2.0.0 stable
DoctrineORM 2.0.0 stable

DoctrineMigration from git://github.com/doctrine/migrations.git (2.0 alpha?)

Attachments: Zip Archive Entities.zip     File migrations.yml     File Version20110115224434.php    


I create entities from doctrine getting started tutorial http://www.doctrine-project.org/docs/orm/2.0/en/tutorials/getting-started-xml-edition.html
It's Bug, User, Project (in attach)
and create config migrations.yml (in attach)

after that i run command "./doctrine migrations:diff" which generated migration file Version20110115224434.php (in attach)
"./doctrine migrations:migrate" work normal
but "./doctrine migrations:migrate 0" dosn't work:

Migrating down to 0 from 20110115224434

– reverting 20110115224434

Migration 20110115224434 failed during Execution. Error SQLSTATE[HY000]: General error: 1005 Can't create table 'doctrine2.#sql-531_108' (errno: 150)

SQLSTATE[HY000]: General error: 1005 Can't create table 'doctrine2.#sql-531_108' (errno: 150)

Comment by Karsten Dambekalns [ 13/Jun/11 ]

The problem is the missing constraint name. I looked up the name the constraint had and added it to the statement and it worked.

Since the names are generated by MySQL automatically, looking them up when generating the migration will probably not work, because the generated name might differ on another setup. What would work is creating names for the constraints and use them in create and drop operations.

Generated at Mon Nov 30 19:28:00 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.