<?php

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

class CreateServiceProjectTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('service_project', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title')->default('')->comment('服务名称');
            $table->string('sub_title')->default('')->comment('副标题');
            $table->string('cover')->nullable()->comment('服务封面');
            $table->double('price')->default('0')->nullable()->comment('服务价格');
            $table->double('init_price')->default('0')->nullable()->comment('服务原价');
            $table->integer('sale')->default('0')->nullable()->comment('虚拟销量');
            $table->integer('true_sale')->default('0')->nullable()->comment('实际销量');
            $table->integer('total_sale')->default('0')->nullable()->comment('总销量');
            $table->integer('time_long')->default('0')->nullable()->comment('服务时长');
            $table->integer('max_time')->default('0')->nullable()->comment('最长预约');
            $table->text('introduce')->nullable()->comment('项目介绍');
            $table->text('explain')->nullable()->comment('禁忌说明');
            $table->text('notice')->nullable()->comment('下单须知');
            $table->string('sort')->default('0')->comment('排序');
            $table->tinyInteger('status')->default('0')->comment('状态');
            $table->tinyInteger('com_balance')->default('0')->comment('分佣比例');
            $table->tinyInteger('is_add')->default('0')->comment('是否加钟服务');
            $table->double('material_price')->default('0')->nullable()->comment('物料费');
            $table->tinyInteger('is_store')->default('0')->comment('是否支持到店');
            $table->tinyInteger('is_door')->default('1')->comment('是否支持上门');
            $table->bigInteger('category_id')->nullable()->comment('所属分类');

            $table->timestamps();
            $table->softDeletes();
        });
    }

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