You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having a problem with migrations:diff constantly regen deleting and adding a foreign key in a table:
finalclass Version20230417120412 extends AbstractMigration
{
publicfunctiongetDescription(): string
{
return'';
}
publicfunctionup(Schema$schema): void
{
// this up() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE project.project DROP CONSTRAINT FK_D9574D85A76ED395');
$this->addSql('ALTER TABLE project.project ADD CONSTRAINT FK_D9574D85A76ED395 FOREIGN KEY (user_id) REFERENCES account."user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
publicfunctiondown(Schema$schema): void
{
// this down() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE project.project DROP CONSTRAINT fk_d9574d85a76ed395');
$this->addSql('ALTER TABLE project.project ADD CONSTRAINT fk_d9574d85a76ed395 FOREIGN KEY (user_id) REFERENCES account."user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
}
I have cleaned the entire database and generated all migrations from scratch but still in each new migration, the code I have given above is generated.
This is what my mappings look like:
$this->addSql('ALTER TABLE CompetitionPersonen DROP FOREIGN KEY FK_CFE7FC3DA5955BB0');
$this->addSql('DROP INDEX idx_cfe7fc3da5955bb0 ON CompetitionPersonen');
$this->addSql('CREATE INDEX IDX_CFE7FC3D34DCD176 ON CompetitionPersonen (person)');
$this->addSql('ALTER TABLE CompetitionPersonen ADD CONSTRAINT FK_CFE7FC3DA5955BB0 FOREIGN KEY (person) REFERENCES Personen (id)');
I'm having a problem with migrations:diff constantly regen deleting and adding a foreign key in a table:
I have cleaned the entire database and generated all migrations from scratch but still in each new migration, the code I have given above is generated.
This is what my mappings look like:
The text was updated successfully, but these errors were encountered: