2022_02_10_184503_create_membership_goods_table.php
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?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');
    }
}