Skip to content

Loading…

DDC-454: Failure in Schema Diff ForeignKey handling when several tables are added #4956

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

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;
@doctrinebot

Comment created by @beberlei:

Hah that was easy, fixed.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0-BETA1 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.