2019_06_14_155026_create_table_feed.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTableFeed extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('feed', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->integer('uid')
  17. ->index('uid')
  18. ->comment('uid');
  19. $table->integer('follow_uid')
  20. ->comment('关注人uid');
  21. $table->string('follow_username')
  22. ->default('')
  23. ->comment('关注人昵称');
  24. $table->string('follow_avatar')
  25. ->default('')
  26. ->comment('关注人头像');
  27. $table->string('type', 32)
  28. ->default('post_create')
  29. ->comment('类型');
  30. $table->integer('relate_id')
  31. ->default(0)
  32. ->comment('相关id');
  33. $table->string('content', 1000)
  34. ->default('')
  35. ->comment('内容');
  36. $table->timestamps();
  37. });
  38. }
  39. /**
  40. * Reverse the migrations.
  41. *
  42. * @return void
  43. */
  44. public function down()
  45. {
  46. Schema::dropIfExists('feed');
  47. }
  48. }