<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; use ModStart\Core\Dao\ModelManageUtil; class CreateBanner extends Migration { public function up() { if (ModelManageUtil::hasTable('banner')) { goto QiNsb; WYQWq: if (!in_array('position', $nmfE0)) { Schema::table('banner', function (Blueprint $GocOS) { $GocOS->string('position', 50)->nullable()->comment('位置'); }); } goto zDyLo; QiNsb: $nmfE0 = ModelManageUtil::listTableColumns('banner'); goto WYQWq; zDyLo: if (!in_array('sort', $nmfE0)) { Schema::table('banner', function (Blueprint $GocOS) { $GocOS->integer('sort')->nullable()->comment('顺序'); }); } goto nJLkL; nJLkL: } else { Schema::create('banner', function (Blueprint $GocOS) { $GocOS->increments('id'); $GocOS->timestamps(); $GocOS->string('position', 50)->nullable()->comment('位置'); $GocOS->integer('sort')->nullable()->comment('顺序'); $GocOS->string('image', 100)->nullable()->comment('图片'); $GocOS->string('link', 200)->nullable()->comment('链接'); }); } } public function down() { } }