xielin 5 years ago
parent
commit
6e6680c495

+ 38 - 0
database/migrations/2019_06_14_192326_create_table_collect.php

@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTableCollect extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post_collect', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->integer('uid')
+                ->index('uid')
+                ->comment('用户ID');
+
+            $table->integer('post_id')
+                ->default(0)
+                ->comment('帖子id');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('post_collect');
+    }
+}

+ 38 - 0
database/migrations/2019_06_14_192526_create_table_post_like.php

@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTablePostLike extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post_like', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->integer('uid')
+                ->index('uid')
+                ->comment('用户ID');
+
+            $table->integer('post_id')
+                ->default(0)
+                ->comment('帖子id');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('post_like');
+    }
+}