<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; use ModStart\Core\Dao\ModelManageUtil; class CreateNav extends Migration { public function up() { if (ModelManageUtil::hasTable('nav')) { goto RoU9B; jOb7Y: if (!in_array('position', $io9PD)) { if (in_array('type', $io9PD)) { Schema::table('nav', function (Blueprint $EeFZ9) { $EeFZ9->renameColumn('type', 'position'); }); } else { Schema::table('nav', function (Blueprint $EeFZ9) { $EeFZ9->string('position', 50)->nullable()->comment('位置'); }); } } goto nMWhL; nMWhL: if (!in_array('name', $io9PD)) { if (in_array('title', $io9PD)) { Schema::table('nav', function (Blueprint $EeFZ9) { $EeFZ9->renameColumn('title', 'name'); }); } else { Schema::table('nav', function (Blueprint $EeFZ9) { $EeFZ9->string('name', 100)->nullable()->comment('图片'); }); } } goto J07p1; J07p1: if (!in_array('link', $io9PD)) { if (in_array('url', $io9PD)) { Schema::table('nav', function (Blueprint $EeFZ9) { $EeFZ9->renameColumn('url', 'link'); }); } else { Schema::table('nav', function (Blueprint $EeFZ9) { $EeFZ9->string('link', 200)->nullable()->comment('链接'); }); } } goto Krez8; RoU9B: $io9PD = ModelManageUtil::listTableColumns('nav'); goto jOb7Y; Krez8: } else { Schema::create('nav', function (Blueprint $EeFZ9) { $EeFZ9->increments('id'); $EeFZ9->timestamps(); $EeFZ9->string('position', 50)->nullable()->comment('位置'); $EeFZ9->integer('sort')->nullable()->comment('顺序'); $EeFZ9->string('name', 100)->nullable()->comment('图片'); $EeFZ9->string('link', 200)->nullable()->comment('链接'); }); } } public function down() { } }