|
@@ -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');
|
|
|
+ }
|
|
|
+}
|