2021_08_12_221137_create_course_chapters_table.php 904 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. //课程章节
  6. class CreateCourseChaptersTable extends Migration
  7. {
  8. /**
  9. * Run the migrations.
  10. *
  11. * @return void
  12. */
  13. public function up()
  14. {
  15. Schema::create('course_chapters', function (Blueprint $table) {
  16. $table->id();
  17. $table->integer('course_id');
  18. $table->string('title')->comment('章节名');
  19. $table->integer('sort')->default(0);
  20. $table->tinyInteger('status')->default(1)->comment('是否显示,1显示,0不显示');
  21. $table->softDeletes();
  22. $table->timestamps();
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::dropIfExists('course_chapters');
  33. }
  34. }