<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateAdmin extends Migration { public function up() { goto SNExS; dEck2: Schema::create('admin_log_data', function (Blueprint $zWXdn) { $zWXdn->increments('id'); $zWXdn->timestamps(); $zWXdn->text('content')->nullable()->comment('内容'); }); goto WIGeJ; SNExS: $pqoX9 = config('modstart.admin.database.connection') ?: config('database.default'); goto duRjY; O2PvK: Schema::connection($pqoX9)->create('admin_user', function (Blueprint $zWXdn) { $zWXdn->increments('id'); $zWXdn->timestamps(); $zWXdn->string('username', 100)->comment('')->nullable(); $zWXdn->char('password', 32)->comment('')->nullable(); $zWXdn->char('passwordSalt', 16)->comment('')->nullable(); $zWXdn->boolean('ruleChanged')->comment('')->nullable(); $zWXdn->timestamp('lastLoginTime')->comment('')->nullable(); $zWXdn->string('lastLoginIp', 20)->comment('')->nullable(); $zWXdn->timestamp('lastChangePwdTime')->comment('')->nullable(); $zWXdn->unique('username'); }); goto jkGRj; duRjY: Schema::connection($pqoX9)->create('admin_role', function (Blueprint $zWXdn) { $zWXdn->increments('id'); $zWXdn->timestamps(); $zWXdn->string('name', 200)->comment('')->nullable(); }); goto woeLr; sem3J: Schema::create('admin_log', function (Blueprint $zWXdn) { $zWXdn->increments('id'); $zWXdn->timestamps(); $zWXdn->integer('adminUserId')->nullable()->comment('用户ID'); $zWXdn->tinyInteger('type')->nullable()->comment('类型'); $zWXdn->string('summary', 400)->nullable()->comment('摘要'); }); goto dEck2; jkGRj: Schema::connection($pqoX9)->create('admin_user_role', function (Blueprint $zWXdn) { $zWXdn->increments('id'); $zWXdn->timestamps(); $zWXdn->unsignedInteger('userId')->nullable(); $zWXdn->unsignedInteger('roleId')->nullable(); $zWXdn->index('userId'); $zWXdn->index('roleId'); }); goto sem3J; woeLr: Schema::connection($pqoX9)->create('admin_role_rule', function (Blueprint $zWXdn) { $zWXdn->increments('id'); $zWXdn->timestamps(); $zWXdn->unsignedInteger('roleId')->comment('')->nullable(); $zWXdn->string('rule', 200)->comment('')->nullable(); $zWXdn->index('roleId'); }); goto O2PvK; WIGeJ: } public function down() { } }