2022_02_10_184503_create_membership_goods_table.php 1.54 KB
<?php

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

class CreateMembershipGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('membership_goods', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('membership_id')->comment('会员id');
            $table->decimal('price')->default('0.00')->comment('价格');
            $table->decimal('line_price')->default('0.00')->comment('划线价格');
            $table->integer('limit_days')->default(0)->comment('有效天数');
            $table->string('limit_unit')->default('')->comment('有效期单位');
            $table->unsignedTinyInteger('terminal')->comment('1=Android,2=IOS');
            $table->unsignedTinyInteger('state')->comment('0=下架,1=售卖中');
            $table->unsignedTinyInteger('sn')->comment('SN顺序');
            $table->unsignedInteger('visits')->default(0)->comment('访问量');
            $table->unsignedInteger('virtual_sales')->default(0)->comment('虚拟销售量');
            $table->unsignedInteger('sales')->default(0)->comment('销售量');
            $table->unsignedInteger('stocks')->default(0)->comment('库存数量');
            $table->timestamps();
        });
    }

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