Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug with migrations downgrade #35

Closed
stfalcon opened this issue May 20, 2011 · 2 comments
Closed

bug with migrations downgrade #35

stfalcon opened this issue May 20, 2011 · 2 comments

Comments

@stfalcon
Copy link

I created two simple entities https://github.com/stfalcon/BlogBundle/tree/master/Entity
And generated migrations diff https://github.com/stfalcon/portfolio/blob/master/app/DoctrineMigrations/Version20110520075206.php

Command doctrine:migrations:migrate works fine. But I get error when try downgrade last migration:

Migrating down to 20110520062748 from 20110520075206

  -- reverting 20110520075206

     -> ALTER TABLE blog_posts_tags DROP FOREIGN KEY 
Migration 20110520075206 failed during Execution. Error SQLSTATE[HY000]: General error: 1005 Can't create table 'stfalcon_com_development.#sql-5af_119' (errno: 150)


                                                                                                                
  [PDOException]                                                                                                
  SQLSTATE[HY000]: General error: 1005 Can't create table 'stfalcon_com_development.#sql-5af_119' (errno: 150)  
                                                                                                                
@zerkalica
Copy link

This is same bug as in my issue: #32, which i report 2 month ago.

Problem in methods Doctrine\DBAL\Platforms\AbstractPlatform::getDropForeignKeySQL() and Doctrine\DBAL\Platforms\AbstractPlatform::getCreateForeignKeySQL()

This methods do not receive FK name and don't put it in sql dump. While executing dump, mysql autogenerate FK names, but at the migration generation moment doctrine knowns nothing about them.

I think, doctrine must generate this names and put it into the schema.

Autogenerated migrations in mysql with fk are unusable.

@beberlei
Copy link
Member

Fixed for 2.0.x and 2.1.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants