<?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 wGfmX; SLerq: if (!in_array('sort', $DdAUN)) { Schema::table('banner', function (Blueprint $onV5E) { $onV5E->integer('sort')->nullable()->comment('顺序'); }); } goto tGhRe; wGfmX: $DdAUN = ModelManageUtil::listTableColumns('banner'); goto yngFF; yngFF: if (!in_array('position', $DdAUN)) { Schema::table('banner', function (Blueprint $onV5E) { $onV5E->string('position', 50)->nullable()->comment('位置'); }); } goto SLerq; tGhRe: } else { Schema::create('banner', function (Blueprint $onV5E) { $onV5E->increments('id'); $onV5E->timestamps(); $onV5E->string('position', 50)->nullable()->comment('位置'); $onV5E->integer('sort')->nullable()->comment('顺序'); $onV5E->string('image', 100)->nullable()->comment('图片'); $onV5E->string('link', 200)->nullable()->comment('链接'); }); } } public function down() { } }