From 3aaecc8630ba0835600e5bd300bc771e93bf796b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 21 Mar 2022 12:32:40 +0100 Subject: [PATCH] set creator as referrer for works --- .../ChillPersonBundle/migrations/Version20220310063629.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220310063629.php b/src/Bundle/ChillPersonBundle/migrations/Version20220310063629.php index 2b4c171a2..9e6f0c332 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220310063629.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220310063629.php @@ -36,5 +36,7 @@ final class Version20220310063629 extends AbstractMigration $this->addSql('CREATE INDEX IDX_3619F5EBA76ED395 ON chill_person_accompanying_period_work_referrer (user_id)'); $this->addSql('ALTER TABLE chill_person_accompanying_period_work_referrer ADD CONSTRAINT FK_3619F5EBB99F6060 FOREIGN KEY (accompanyingperiodwork_id) REFERENCES chill_person_accompanying_period_work (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_person_accompanying_period_work_referrer ADD CONSTRAINT FK_3619F5EBA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('INSERT INTO chill_person_accompanying_period_work_referrer (accompanyingperiodwork_id, user_id) + SELECT id, createdby_id FROM postgres.public.chill_person_accompanying_period_work'); } }