2021_07_28_115218_create_requirements_table.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateRequirementsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('requirements', function (Blueprint $table) {
  15. $table->id();
  16. $table->integer('user_id')->comment('创建者');
  17. $table->decimal('score')->comment('');
  18. $table->timestamp('began_at')->nullable()->comment('任务开始时间');
  19. $table->timestamp('finished_at')->nullable()->comment('完结时间');
  20. $table->string('title')->nullable()->index()->comment('标题');
  21. $table->text('content')->nullable()->comment('内容');
  22. $table->tinyInteger('status')->comment('状态');
  23. $table->softDeletes();
  24. $table->timestamps();
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('requirements');
  35. }
  36. }