瀏覽代碼

Add new migration

Daniel Supernault 6 年之前
父節點
當前提交
5b90bec1b3
共有 1 個文件被更改,包括 34 次插入0 次删除
  1. 34 0
      database/migrations/2018_10_17_233623_update_follower_table_add_remote_flags.php

+ 34 - 0
database/migrations/2018_10_17_233623_update_follower_table_add_remote_flags.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class UpdateFollowerTableAddRemoteFlags extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('followers', function (Blueprint $table) {
+            $table->boolean('local_profile')->default(true)->index()->after('following_id');
+            $table->boolean('local_following')->default(true)->index()->after('local_profile');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('followers', function (Blueprint $table) {
+            $table->dropColumn('local_profile');
+            $table->dropColumn('local_following');
+        });
+    }
+}