2019_07_29_095032_create_table_feeds.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTableFeeds extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. for($i = 0; $i < 10; $i++){
  15. Schema::create('feed_'.$i, function (Blueprint $table) {
  16. $table->bigIncrements('id');
  17. $table->integer('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. /**
  41. * Reverse the migrations.
  42. *
  43. * @return void
  44. */
  45. public function down()
  46. {
  47. Schema::dropIfExists('feed');
  48. }
  49. }