Zhouzhendong 5 лет назад
Родитель
Сommit
d8e2f650b8

+ 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();
+        });
+    }
+}