addSql('CREATE TABLE bovine (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, building_case_id INT DEFAULT NULL, national_number VARCHAR(50) NOT NULL, received_weight INT DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX IDX_EA9E2A42F8D859DF ON bovine (building_case_id)'); $this->addSql('CREATE UNIQUE INDEX uniq_bovine_national_number ON bovine (national_number)'); $this->addSql('ALTER TABLE bovine ADD CONSTRAINT FK_EA9E2A42F8D859DF FOREIGN KEY (building_case_id) REFERENCES building_case (id) NOT DEFERRABLE'); } public function down(Schema $schema): void { $this->addSql('ALTER TABLE bovine DROP CONSTRAINT FK_EA9E2A42F8D859DF'); $this->addSql('DROP TABLE bovine'); } }