addSql('CREATE TABLE service_item_consumables (id INT AUTO_INCREMENT NOT NULL, amount INT NOT NULL, service_item_id INT NOT NULL, item_id INT NOT NULL, INDEX IDX_DC02A217DDEB00C2 (service_item_id), INDEX IDX_DC02A217126F525E (item_id), UNIQUE INDEX uniq_service_item_consumable (service_item_id, item_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4'); $this->addSql('ALTER TABLE service_item_consumables ADD CONSTRAINT FK_DC02A217DDEB00C2 FOREIGN KEY (service_item_id) REFERENCES service_items (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE service_item_consumables ADD CONSTRAINT FK_DC02A217126F525E FOREIGN KEY (item_id) REFERENCES inventory_items (id) ON DELETE CASCADE'); } public function down(Schema $schema): void { $this->addSql('ALTER TABLE service_item_consumables DROP FOREIGN KEY FK_DC02A217DDEB00C2'); $this->addSql('ALTER TABLE service_item_consumables DROP FOREIGN KEY FK_DC02A217126F525E'); $this->addSql('DROP TABLE service_item_consumables'); } }