Skip to content

Commit

Permalink
Merge pull request #2522 from EnMarche/fix-migration
Browse files Browse the repository at this point in the history
Fix migration: primary key should be auto increment when added
  • Loading branch information
B-Galati committed Jun 18, 2018
2 parents 5bd9993 + 4dbb030 commit 5fcc192
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/migrations/Version20180524165445.php
Expand Up @@ -23,9 +23,7 @@ public function up(Schema $schema)
$this->addSql('ALTER TABLE adherent_email_subscription_histories DROP FOREIGN KEY FK_272CB3E99C262DB3');
$this->addSql('DROP INDEX IDX_51AD83549C262DB3 ON adherent_email_subscription_histories');
$this->addSql('ALTER TABLE adherent_email_subscription_histories DROP PRIMARY KEY');
$this->addSql('ALTER TABLE adherent_email_subscription_histories ADD id INT UNSIGNED NOT NULL, DROP uuid, DROP referent_tag_id');
$this->addSql('ALTER TABLE adherent_email_subscription_histories ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE adherent_email_subscription_histories CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL');
$this->addSql('ALTER TABLE adherent_email_subscription_histories ADD id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT NOT NULL, DROP uuid, DROP referent_tag_id');
$this->addSql('ALTER TABLE adherent_email_subscription_history_referent_tag ADD CONSTRAINT FK_6FFBE6E88FCB8132 FOREIGN KEY (email_subscription_history_id) REFERENCES adherent_email_subscription_histories (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE adherent_email_subscription_history_referent_tag ADD CONSTRAINT FK_6FFBE6E89C262DB3 FOREIGN KEY (referent_tag_id) REFERENCES referent_tags (id) ON DELETE CASCADE');
}
Expand Down

0 comments on commit 5fcc192

Please sign in to comment.