2020_07_24_143657_create_scales_table.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateScalesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('scales', function (Blueprint $table) {
  15. $table->id();
  16. $table->bigInteger('category_id')->comment('分类id')->index();
  17. $table->bigInteger('third_id')->comment('统一第三方量表id')->index();
  18. $table->string('title')->comment('标题');
  19. $table->string('subtitle')->nullable()->comment('副标题');
  20. $table->string('pic')->comment('图片');
  21. $table->longText('content')->comment('内容');
  22. $table->integer('time')->default(0)->comment('测试时间');
  23. $table->string('suitable_for_the_crowd')->nullable()->comment('适合人群');
  24. $table->integer('number_of_questions')->default(0)->comment('问题数');
  25. $table->integer('number_of_replay')->default(0)->comment('报告数');
  26. $table->integer('number_of_test')->default(0)->comment('测试次数')->index();
  27. $table->text('notice')->nullable()->comment('测试须知');
  28. $table->bigInteger('rank')->default(0)->comment('排序 越大越前')->index();
  29. $table->timestamps();
  30. $table->softDeletes();
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('scales');
  41. }
  42. }