2019_01_19_104456_create_questions_table.php 928 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateQuestionsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('questions', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('name', 60)->comment('题目名称');
  17. $table->string('options', 60)->comment('题目选项');
  18. $table->string('answers', 60)->comment('题目答案');
  19. $table->boolean('radio')->comment("是否单选");
  20. $table->string('type', 60)->comment('题目类型');
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::dropIfExists('questions');
  32. }
  33. }