2020_10_19_095549_create_yz_answer.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateYzAnswer extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. //答案表
  15. if (!Schema::hasTable('yz_answer')) {
  16. Schema::create('yz_answer', function (Blueprint $table) {
  17. $table->increments('id');
  18. $table->integer('uniacid')->nullable()->comment('公众号ID');
  19. $table->integer('subject_id')->nullable()->comment('题目id');
  20. $table->string('content',255)->nullable()->comment('答案内容');
  21. $table->integer('answer')->nullable()->comment('正确答案');
  22. $table->integer('created_at')->nullable();
  23. $table->integer('updated_at')->nullable();
  24. $table->integer('deleted_at')->nullable();
  25. });
  26. \Illuminate\Support\Facades\DB::statement("ALTER TABLE `".app('db')->getTablePrefix()."yz_answer` comment'短视频答题--答案表'");//表注释
  27. }
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down()
  35. {
  36. //
  37. }
  38. }