2022_01_04_093052_create_membership_table.php 1.3 KB
<?php

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

class CreateMembershipTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('membership', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->default('')->comment('会员名称');
            $table->decimal('price')->comment('价格(分)');
            $table->decimal('origin_price')->comment('原价(分)');
            $table->integer('limit_days')->comment('有效天数');
            $table->string('limit_unit')->comment('有效期单位');
            $table->string('intro')->default('')->comment('简介');
            $table->string('image')->default('')->comment('介绍图');
            $table->unsignedTinyInteger('sale_term')->default('')->comment('上架终端');
            $table->unsignedTinyInteger('state')->comment('状态:1=售卖中');
            $table->unsignedTinyInteger('sn')->comment('SN顺序');
            $table->timestamps();
        });
    }

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