I have the following migration:
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdateRatingGameUserAnswersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('rating_games_user_answers', function (Blueprint $table) {
$table->uuid('answer_token')->default(DB::raw('UUID()'));
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('rating_games_user_answers', function (Blueprint $table) {
$table->dropColumn('answer_token');
});
}
}
As you can see I'm trying to set UUID as default value. I've seen it here
But when I run php artisan migrate
I see the following:
What is wrong?