字面意思 xxx表已存在.
在使用laravel 寫同步結構的時候 最好習慣性寫個if語句判定是否存在
// 判斷數據表是否存在
Schema::hasTable('table');
// 判斷數據表是否有該列
Schema::hasColumn('table', 'column');
實例:
public function up()
{
Schema::create('xxx', function (Blueprint $table) {
//
if (!Schema::hasTable('xxx')) {
$table->engine='innodb';
$table->tinyInteger('status')->default(0)->after('xxx2')->comment('狀態 0:非 1:是');
}
});
}
