<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; use ModStart\Core\Dao\ModelManageUtil; class CreatePartner extends Migration { public function up() { if (ModelManageUtil::hasTable('partner')) { goto y7kMI; QZHFH: if (!in_array('sort', $foNFK)) { Schema::table('partner', function (Blueprint $fnOXp) { $fnOXp->integer('sort')->nullable()->comment('排序'); }); } goto pAiEW; XNhry: if (!in_array('position', $foNFK)) { Schema::table('partner', function (Blueprint $fnOXp) { $fnOXp->string('position', 50)->nullable()->comment('位置'); }); } goto QZHFH; y7kMI: $foNFK = ModelManageUtil::listTableColumns('partner'); goto XNhry; pAiEW: } else { Schema::create('partner', function (Blueprint $fnOXp) { $fnOXp->increments('id'); $fnOXp->timestamps(); $fnOXp->string('position', 50)->nullable()->comment('位置'); $fnOXp->integer('sort')->nullable()->comment('排序'); $fnOXp->string('title', 20)->nullable()->comment('名称'); $fnOXp->string('logo', 200)->nullable()->comment('Logo'); $fnOXp->string('link', 200)->nullable()->comment('链接'); }); } } public function down() { } }