<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_comments', function (Blueprint $table) {
            $table->comment('订单评论');
            $table->increments('id');
            $table->unsignedBigInteger('order_id')->comment('订单编号');
            $table->unsignedBigInteger('user_id')->comment('用户编号');
            $table->unsignedBigInteger('coach_id')->comment('技师编号');
            $table->text('content')->nullable()->comment('评论内容');
            $table->unsignedTinyInteger('rating')->default(new \Illuminate\Database\Query\Expression('5'))->comment('评论星级');
            $table->string('state')->default('ENABLE')->comment('状态');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_comments');
    }
};
