addSql('CREATE TABLE website_configuration (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, type VARCHAR(25) NOT NULL, value TEXT NOT NULL, website_id INT NOT NULL, PRIMARY KEY (id))'); $this->addSql('CREATE INDEX IDX_8BC287E818F45C82 ON website_configuration (website_id)'); $this->addSql('CREATE UNIQUE INDEX UNIQ_8BC287E818F45C828CDE5729 ON website_configuration (website_id, type)'); $this->addSql('ALTER TABLE website_configuration ADD CONSTRAINT FK_8BC287E818F45C82 FOREIGN KEY (website_id) REFERENCES website (id) ON DELETE CASCADE NOT DEFERRABLE'); $this->addSql('ALTER TABLE website ADD revendeur_code VARCHAR(10) DEFAULT NULL'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE website_configuration DROP CONSTRAINT FK_8BC287E818F45C82'); $this->addSql('DROP TABLE website_configuration'); $this->addSql('ALTER TABLE website DROP revendeur_code'); } }