2019_06_03_094442_create_topic_table.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTopicTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('topic', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->string('name')->nullable()->comment('话题名称');
  17. $table->string('img')->nullable()->comment('话题图片');
  18. //$table->integer('post_num')->default(0)->comment('内容数');
  19. //$table->integer('follow_num')->default(0)->comment('关注数');
  20. // $table->integer('praise_num')->default(0)->comment('点赞数');
  21. // $table->integer('pv_num')->default(0)->comment('浏览数');
  22. $table->tinyInteger('is_suggest')->default(0)->comment('是否推荐');
  23. $table->tinyInteger('is_hot')->default(0)->comment('是否热门');
  24. $table->tinyInteger('is_open')->default(0)->comment('是否开启');
  25. $table->string('desc')->comment('描述');
  26. $table->softDeletes();
  27. $table->timestamps();
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('topic');
  38. }
  39. }