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. migrations.yml
        0.1 kB
        Stepan Tanasiychuk
      2. Version20110115224434.php
        2 kB
        Stepan Tanasiychuk

        Activity

        Stepan Tanasiychuk created issue -
        Stepan Tanasiychuk made changes -
        Field Original Value New Value
        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:
        {quote}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) {quote}
        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:
        {quote}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) {quote}
        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.
        Benjamin Eberlei made changes -
        Assignee Jonathan H. Wage [ jwage ] Benjamin Eberlei [ beberlei ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DMIG-17, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated: