Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-454

Failure in Schema Diff ForeignKey handling when several tables are added

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-ALPHA4
    • Fix Version/s: 2.0-BETA1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      If you add several new tables and make a schema diff, these tables foreign key relations to each other are not sorted properly leading to possible errors:

      benny@benny-pc:~/code/php/wsnetbeans/whitewashing$ doctrine orm:schema-tool --update --dump-sql
      Doctrine Command Line Interface
      
      CREATE TABLE blog_posts_tags (post_id INT NOT NULL, tag_id VARCHAR(255) NOT NULL, INDEX blog_posts_tags_tag_id_idx (tag_id), PRIMARY KEY(post_id, tag_id)) ENGINE = InnoDB;
      ALTER TABLE blog_posts_tags ADD FOREIGN KEY (post_id) REFERENCES blog_posts(id);
      ALTER TABLE blog_posts_tags ADD FOREIGN KEY (tag_id) REFERENCES blog_tags(id);
      CREATE TABLE blog_tags (tag_name VARCHAR(255) NOT NULL, id VARCHAR(255) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Hah that was easy, fixed.

        Show
        Benjamin Eberlei added a comment - Hah that was easy, fixed.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: