addSql('CREATE TABLE patient_attachments (id INT AUTO_INCREMENT NOT NULL, uuid VARCHAR(36) NOT NULL, name VARCHAR(200) NOT NULL, url VARCHAR(500) NOT NULL, mime VARCHAR(100) DEFAULT NULL, size INT DEFAULT NULL, created_at INT NOT NULL, record_id INT NOT NULL, UNIQUE INDEX UNIQ_77C7C599D17F50A6 (uuid), INDEX idx_patient_attachments_record (record_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4'); $this->addSql('ALTER TABLE patient_attachments ADD CONSTRAINT FK_77C7C5994DFD750C FOREIGN KEY (record_id) REFERENCES patient_records (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 patient_attachments DROP FOREIGN KEY FK_77C7C5994DFD750C'); $this->addSql('DROP TABLE patient_attachments'); } }