addSql('CREATE TABLE clinic_staff (id INT AUTO_INCREMENT NOT NULL, uuid VARCHAR(36) NOT NULL, entity_type VARCHAR(10) NOT NULL, entity_id INT NOT NULL, full_name VARCHAR(200) NOT NULL, phone VARCHAR(20) DEFAULT NULL, job_title VARCHAR(100) DEFAULT NULL, address LONGTEXT DEFAULT NULL, national_code VARCHAR(10) DEFAULT NULL, active TINYINT NOT NULL, created_at INT NOT NULL, updated_at INT NOT NULL, UNIQUE INDEX UNIQ_CBEA5AA1D17F50A6 (uuid), INDEX idx_staff_entity_active (entity_type, entity_id, active), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4'); $this->addSql('ALTER TABLE doctor_addresses DROP FOREIGN KEY `FK_doctor_addr_clinic`'); $this->addSql('ALTER TABLE doctor_addresses CHANGE type type VARCHAR(10) NOT NULL'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('DROP TABLE clinic_staff'); $this->addSql('ALTER TABLE doctor_addresses CHANGE type type VARCHAR(10) DEFAULT \'personal\' NOT NULL'); $this->addSql('ALTER TABLE doctor_addresses ADD CONSTRAINT `FK_doctor_addr_clinic` FOREIGN KEY (clinic_id) REFERENCES clinics (id) ON DELETE CASCADE'); } }