2020_07_27_111702_create_diary_moods_table.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateDiaryMoodsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('diary_moods', function (Blueprint $table) {
  15. $table->id();
  16. $table->bigInteger('uid')->comment('用户id')->index();
  17. $table->bigInteger('level_id')->comment('心情好坏id')->index();
  18. $table->json('tag')->nullable()->comment('标题id');
  19. $table->string('title')->nullable()->comment('标题');
  20. $table->string('content')->nullable()->comment('内容');
  21. $table->integer('score')->default(0)->comment('分数');
  22. $table->timestamps();
  23. $table->softDeletes();
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('diary_moods');
  34. }
  35. }