Ver código fonte

Merge remote-tracking branch 'origin/develop' into develop

wzq 5 anos atrás
pai
commit
048120188c

+ 36 - 0
database/migrations/2019_06_03_094309_create_category_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateCategoryTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('category', function (Blueprint $table) {
+            $table->bigIncrements('id')->comment('表ID');
+            $table->string('name')->nullable()->comment('分类名称');
+            $table->string('img')->nullable()->comment('分类图片');
+            $table->tinyInteger('is_suggest')->default(0)->comment('是否推荐');
+            $table->text('desc')->comment('描述');
+            $table->softDeletes();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('category');
+    }
+}

+ 34 - 0
database/migrations/2019_06_03_094426_create_category_topic_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateCategoryTopicTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('category_topic', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->integer('category_id')->nullable()->comment('分类ID');
+            $table->integer('topic_id')->nullable()->comment('话题ID');
+            $table->softDeletes();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('category_topic');
+    }
+}

+ 42 - 0
database/migrations/2019_06_03_094442_create_topic_table.php

@@ -0,0 +1,42 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTopicTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('topic', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->string('name')->nullable()->comment('话题名称');
+            $table->string('img')->nullable()->comment('话题图片');
+            //$table->integer('post_num')->default(0)->comment('内容数');
+            //$table->integer('follow_num')->default(0)->comment('关注数');
+           // $table->integer('praise_num')->default(0)->comment('点赞数');
+           // $table->integer('pv_num')->default(0)->comment('浏览数');
+            $table->tinyInteger('is_suggest')->default(0)->comment('是否推荐');
+            $table->tinyInteger('is_hot')->default(0)->comment('是否热门');
+            $table->tinyInteger('is_open')->default(0)->comment('是否开启');
+            $table->string('desc')->comment('描述');
+            $table->softDeletes();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('topic');
+    }
+}