addSql('CREATE SEQUENCE common_list_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE TABLE common_list (id INT NOT NULL, film_id INT NOT NULL, added_by_id INT NOT NULL, date_added DATE NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX IDX_F450E089567F5183 ON common_list (film_id)'); $this->addSql('CREATE INDEX IDX_F450E08955B127A4 ON common_list (added_by_id)'); $this->addSql('COMMENT ON COLUMN common_list.date_added IS \'(DC2Type:date_immutable)\''); $this->addSql('ALTER TABLE common_list ADD CONSTRAINT FK_F450E089567F5183 FOREIGN KEY (film_id) REFERENCES film (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE common_list ADD CONSTRAINT FK_F450E08955B127A4 FOREIGN KEY (added_by_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('DROP SEQUENCE common_list_id_seq CASCADE'); $this->addSql('ALTER TABLE common_list DROP CONSTRAINT FK_F450E089567F5183'); $this->addSql('ALTER TABLE common_list DROP CONSTRAINT FK_F450E08955B127A4'); $this->addSql('DROP TABLE common_list'); } }