addSql('ALTER TABLE appointments ADD resource_id INT DEFAULT NULL, ADD service_option_item_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE appointments ADD CONSTRAINT FK_6A41727A89329D25 FOREIGN KEY (resource_id) REFERENCES clinic_resources (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE appointments ADD CONSTRAINT FK_6A41727A9FD189D FOREIGN KEY (service_option_item_id) REFERENCES service_items (id) ON DELETE SET NULL'); $this->addSql('CREATE INDEX IDX_6A41727A89329D25 ON appointments (resource_id)'); $this->addSql('CREATE INDEX IDX_6A41727A9FD189D ON appointments (service_option_item_id)'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE appointments DROP FOREIGN KEY FK_6A41727A89329D25'); $this->addSql('ALTER TABLE appointments DROP FOREIGN KEY FK_6A41727A9FD189D'); $this->addSql('DROP INDEX IDX_6A41727A89329D25 ON appointments'); $this->addSql('DROP INDEX IDX_6A41727A9FD189D ON appointments'); $this->addSql('ALTER TABLE appointments DROP resource_id, DROP service_option_item_id'); } }