<?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('coach_project', function (Blueprint $table) {
            $table->comment('技师开通服务项目');
            $table->increments('id');
            $table->unsignedBigInteger('coach_id')->comment('技师ID');
            $table->unsignedBigInteger('project_id')->comment('项目ID');
            $table->decimal('discount_amount')->default(new \Illuminate\Database\Query\Expression('0.00'))->comment('优惠金额');
            $table->string('service_gender')->default('all')->comment('服务性别(all:不限 male:男 female:女)');
            $table->integer('service_distance')->default(new \Illuminate\Database\Query\Expression('0'))->comment('服务距离(米)');
            $table->string('traffic_fee_type')->default('free')->comment('收取路费(free:免费 one_way:单程 round_trip:双程)');
            $table->decimal('traffic_fee')->default(new \Illuminate\Database\Query\Expression('0.00'))->comment('路费金额');
            $table->string('state')->default('enable')->comment('状态(enable:启用 disable:禁用)');
            $table->timestamps();
            $table->softDeletes();
        });
    }

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