瀏覽代碼

Correction migration supp videos orphelines

François Drouhard 1 年之前
父節點
當前提交
3803a8fdfa
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      migrations/Version20230419104506.php

+ 2 - 0
migrations/Version20230419104506.php

@@ -29,6 +29,8 @@ final class Version20230419104506 extends AbstractMigration
             ]);
         }
 
+        $this->addSql('DELETE FROM media_video WHERE (film_id = 0)');
+
         $this->addSql('ALTER TABLE media_video ADD CONSTRAINT FK_63DE1E9D567F5183 FOREIGN KEY (film_id) REFERENCES film (id)');
         $this->addSql('CREATE INDEX IDX_63DE1E9D567F5183 ON media_video (film_id)');
     }