id(); $table->bigInteger('uid')->comment('用户id'); $table->bigInteger('level_id')->comment('等级id')->index(); $table->date('day')->comment('某天'); $table->dateTime('start_time')->comment('开始时间'); $table->dateTime('end_time')->comment('结束时间'); $table->string('duration_of_time')->comment('持续时间'); $table->decimal('score', 10, 2)->default(0.00)->comment('睡眠得分'); $table->string('repeat')->comment('去重 day:uid')->unique(); $table->timestamps(); $table->softDeletes(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('diary_sleeps'); } }