wzq 5 年 前
コミット
486795232a
共有1 個のファイルを変更した40 個の追加0 個の削除を含む
  1. 40 0
      database/migrations/2019_08_16_143321_add_pv_to_table_topic.php

+ 40 - 0
database/migrations/2019_08_16_143321_add_pv_to_table_topic.php

@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddPvToTableTopic extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('topic', function (Blueprint $table) {
+            $table->integer('follow_count')
+                ->default(0)
+                ->after('use_count')
+                ->comment('关注数');
+
+            $table->integer('pv')
+                ->default(0)
+                ->after('follow_count')
+                ->comment('浏览量');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('topic', function (Blueprint $table) {
+            //
+        });
+    }
+}