Bladeren bron

数据迁移—建立新的字段

jingyuzhi 4 jaren geleden
bovenliggende
commit
09d519d611
1 gewijzigde bestanden met toevoegingen van 34 en 0 verwijderingen
  1. 34 0
      database/migrations/2020_11_25_095040_add_field.php

+ 34 - 0
database/migrations/2020_11_25_095040_add_field.php

xqd
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddField extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        //
+        Schema::table('vaccines', function (Blueprint $table) {
+            $table->unsignedTinyInteger('states');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+        Schema::table('vaccines', function (Blueprint $table) {
+            $table->dropColumn('states');
+        });
+    }
+}