<?php
 use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateVipArticle extends Migration { public function up() { Schema::create('vip_article_category', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); $table->integer('pid')->comment('父ID')->nullable(); $table->integer('sort')->comment('排序，越小越靠前')->nullable(); $table->string('name', 20)->nullable()->comment('名称'); }); Schema::create('vip_article', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); $table->integer('categoryId')->comment('分类ID')->nullable(); $table->decimal('fee', 20, 2)->nullable()->comment(''); $table->string('title', 200)->nullable()->comment('标题'); $table->text('previewContent')->nullable()->comment(''); $table->text('content')->nullable()->comment(''); }); Schema::create('vip_article_pay', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); $table->integer('memberUserId')->comment('')->nullable(); $table->integer('articleId')->comment('')->nullable(); $table->unique(['memberUserId', 'articleId']); }); Schema::create('vip_article_order', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); $table->integer('memberUserId')->comment('')->nullable(); $table->integer('articleId')->comment('')->nullable(); $table->tinyInteger('status')->comment('')->nullable(); $table->decimal('payFee', 20, 2)->nullable()->comment(''); }); } public function down() { } } 