fix sql migration syntax

This commit is contained in:
Mathieu Jaumotte 2021-04-13 15:31:04 +02:00
parent aa05223a4e
commit cc40e7a99a

View File

@ -35,7 +35,7 @@ final class Version20210326113045 extends AbstractMigration
$this->addSql('ALTER TABLE persons_accompanying_periods ADD CONSTRAINT FK_49A3871F550B0C53 FOREIGN KEY (accompanyingperiod_id) REFERENCES chill_person_accompanying_period (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
// insert datas in new join table
$this->addSql('INSERT INTO persons_accompanying_periods (person_id, accompanyingperiod_id)'
$this->addSql('INSERT INTO persons_accompanying_periods (person_id, accompanyingperiod_id) '
. 'SELECT person_id, id as accompagnying_period_id FROM chill_person_accompanying_period WHERE person_id IS NOT NULL');
// drop column