浏览代码

修改字段类型

durong 5 年之前
父节点
当前提交
acac00f5fd
共有 1 个文件被更改,包括 32 次插入0 次删除
  1. 32 0
      database/migrations/2019_06_29_164707_update_physical_strength_to_behavior_table.php

+ 32 - 0
database/migrations/2019_06_29_164707_update_physical_strength_to_behavior_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class UpdatePhysicalStrengthToBehaviorTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('behavior', function (Blueprint $table) {
+            $table->integer('physical_strength')->default(0)->comment('行为消耗体力值')->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('behavior', function (Blueprint $table) {
+            //
+        });
+    }
+}