I'm trying to change an enum value in database with Laravel migrations.
In first, i have tried this classic change :
Schema::table('questionnaires', function ($table) {
$table->enum('type', ['image', 'sound', 'video'])->nullable()->default('image')->change();
});
But I got the following error :
Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it
I solved my problem by doing SQL directly :
DB::statement("ALTER TABLE questionnaires MODIFY COLUMN type ENUM('image', 'sound', 'video') DEFAULT 'image'");
But it does not seem optimal to me...
Is there a solution more in "agreement" with Laravel 8, without going through pure SQL?
Thanks