Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:

      Description

      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

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

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

      1. Version20110115224434.php
        2 kB
        Stepan Tanasiychuk
      2. migrations.yml
        0.1 kB
        Stepan Tanasiychuk

        Activity

        Hide
        Karsten Dambekalns added a comment -

        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.

        Show
        Karsten Dambekalns added a comment - 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.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Stepan Tanasiychuk
          • Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: