12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class CreateDiaryMoodsTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('diary_moods', function (Blueprint $table) {
- $table->id();
-
- $table->bigInteger('uid')->comment('用户id')->index();
- $table->bigInteger('level_id')->comment('心情好坏id')->index();
- $table->json('tag')->nullable()->comment('标题id');
- $table->string('title')->nullable()->comment('标题');
- $table->string('content')->nullable()->comment('内容');
- $table->integer('score')->default(0)->comment('分数');
-
- $table->timestamps();
- $table->softDeletes();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('diary_moods');
- }
- }
|