addSql('UPDATE comment SET date_submit = FROM_UNIXTIME(CAST(date_submit AS UNSIGNED)) WHERE date_submit REGEXP "^[0-9]+$"'); // Then change the column type $this->addSql('ALTER TABLE comment CHANGE date_submit date_submit DATETIME NOT NULL'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE comment CHANGE date_submit date_submit VARCHAR(255) NOT NULL'); } }