addSql('CREATE TABLE rating (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, score SMALLINT DEFAULT NULL, subject_id INT NOT NULL, PRIMARY KEY (id))'); $this->addSql('CREATE INDEX IDX_D889262223EDC87 ON rating (subject_id)'); $this->addSql('ALTER TABLE rating ADD CONSTRAINT FK_D889262223EDC87 FOREIGN KEY (subject_id) REFERENCES subject (id) NOT DEFERRABLE'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE rating DROP CONSTRAINT FK_D889262223EDC87'); $this->addSql('DROP TABLE rating'); } }