Skip to content

Commit

Permalink
add: migration
Browse files Browse the repository at this point in the history
  • Loading branch information
eddy8 committed Dec 6, 2021
1 parent 3e8922c commit 30169fb
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCategoryEntityIdToEntityFieldsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('entity_fields', function (Blueprint $table) {
$table->unsignedInteger('category_entity_id')
->nullable(false)->default(0)->comment('引用分类数据的模型ID');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('entity_fields', function (Blueprint $table) {
$table->dropColumn('category_entity_id');
});
}
}

0 comments on commit 30169fb

Please sign in to comment.