addSql('CREATE TABLE appointment_service_items (appointment_id INT NOT NULL, service_item_id INT NOT NULL, INDEX IDX_3624BA00E5B533F9 (appointment_id), INDEX IDX_3624BA00DDEB00C2 (service_item_id), PRIMARY KEY (appointment_id, service_item_id)) DEFAULT CHARACTER SET utf8mb4'); $this->addSql('ALTER TABLE appointment_service_items ADD CONSTRAINT FK_3624BA00E5B533F9 FOREIGN KEY (appointment_id) REFERENCES appointments (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE appointment_service_items ADD CONSTRAINT FK_3624BA00DDEB00C2 FOREIGN KEY (service_item_id) REFERENCES service_items (id) ON DELETE CASCADE'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE appointment_service_items DROP FOREIGN KEY FK_3624BA00E5B533F9'); $this->addSql('ALTER TABLE appointment_service_items DROP FOREIGN KEY FK_3624BA00DDEB00C2'); $this->addSql('DROP TABLE appointment_service_items'); } }