2021_07_28_115218_create_requirements_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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->text('title')->nullable()->comment('标题');
  21. $table->text('content')->nullable()->comment('内容');
  22. $table->tinyInteger('status')->comment('状态');
  23. $table->softDeletes();
  24. $table->timestamps();
  25. $table->index(['title']);
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::dropIfExists('requirements');
  36. }
  37. }