addSql('CREATE TABLE task_occurrence (id INT AUTO_INCREMENT NOT NULL, date DATE NOT NULL, status VARCHAR(20) NOT NULL, task_id INT NOT NULL, INDEX IDX_A2EECA5C8DB60186 (task_id), UNIQUE INDEX UNIQ_A2EECA5C8DB60186AA9E377A (task_id, date), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4'); $this->addSql('ALTER TABLE task_occurrence ADD CONSTRAINT FK_A2EECA5C8DB60186 FOREIGN KEY (task_id) REFERENCES task (id) ON DELETE CASCADE'); $this->addSql("INSERT INTO task_occurrence (task_id, date, status) SELECT task_id, date, 'erledigt' FROM task_completion"); $this->addSql('ALTER TABLE task_completion DROP FOREIGN KEY FK_24C57CD18DB60186'); $this->addSql('DROP TABLE task_completion'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE task_occurrence DROP FOREIGN KEY FK_A2EECA5C8DB60186'); $this->addSql('DROP TABLE task_occurrence'); } }