瀏覽代碼

修改CarType表

Zhouzhendong 5 年之前
父節點
當前提交
d8e2f650b8
共有 1 個文件被更改,包括 34 次插入0 次删除
  1. 34 0
      database/migrations/2021_05_20_142418_change_car_types_add_length_column.php

+ 34 - 0
database/migrations/2021_05_20_142418_change_car_types_add_length_column.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeCarTypesAddLengthColumn extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('car_types', function (Blueprint $table) {
+            $table->string('length')->comment('车长(米)')->change();
+            $table->string('load')->nullable()->comment('载重(吨)')->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('car_types', function (Blueprint $table) {
+            $table->decimal('length')->comment('车长(米)')->change();
+            $table->decimal('load')->nullable()->comment('载重(吨)')->change();
+        });
+    }
+}