2019_06_03_162403_create_table_post_data.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTablePostData extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('post_data', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->integer('post_id')
  17. ->index('post_id')
  18. ->comment('帖子id');
  19. $table->integer('pv')
  20. ->default(0)
  21. ->comment('pv');
  22. $table->integer('pv_real')
  23. ->default(0)
  24. ->comment('实际pv');
  25. $table->integer('dislike_count')
  26. ->default(0)
  27. ->comment('不喜欢数');
  28. $table->integer('praise_count')
  29. ->default(0)
  30. ->comment('点赞数');
  31. $table->integer('praise_real_count')
  32. ->default(0)
  33. ->comment('实际点赞数');
  34. $table->integer('share_count')
  35. ->default(0)
  36. ->comment('分享数');
  37. $table->integer('share_real_count')
  38. ->default(0)
  39. ->comment('实际分享数');
  40. $table->integer('comment_count')
  41. ->default(0)
  42. ->comment('评论数');
  43. $table->integer('comment_real_count')
  44. ->default(0)
  45. ->comment('实际评论数');
  46. $table->integer('collect_count')
  47. ->default(0)
  48. ->comment('收藏数');
  49. $table->integer('collect_real_count')
  50. ->default(0)
  51. ->comment('实际收藏数');
  52. $table->integer('available_bean')
  53. ->default(0)
  54. ->comment('预计可获得U米数');
  55. $table->integer('will_collect_bean')
  56. ->default(0)
  57. ->comment('待收获U米数');
  58. $table->integer('collect_bean')
  59. ->default(0)
  60. ->comment('领取U米');
  61. $table->decimal('weight', 8, 2)
  62. ->default(0)
  63. ->comment('权重');
  64. $table->timestamps();
  65. });
  66. }
  67. /**
  68. * Reverse the migrations.
  69. *
  70. * @return void
  71. */
  72. public function down()
  73. {
  74. Schema::dropIfExists('post_data');
  75. }
  76. }