2021_08_12_221323_create_course_videos_table.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateCourseVideosTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('course_videos', function (Blueprint $table) {
  15. $table->id();
  16. $table->integer('admin_id');
  17. $table->integer('course_id');
  18. $table->string('title')->comment('标题');
  19. $table->string('slug')->comment('slug');
  20. $table->string('url', 500)->default('')->comment('播放地址');
  21. $table->integer('view_num')->default(0)->comment('观看次数');
  22. $table->string('short_description', 500)->default('')->comment('简短介绍');
  23. $table->text('description')->comment('详细介绍');
  24. $table->timestamp('published_at')->default(null)->nullable(true)->comment('上线时间');
  25. $table->string('aliyun_video_id')->default('')->nullable();
  26. $table->string('tencent_video_id')->default('')->nullable();
  27. $table->integer('course_chapter_id')->default(0);
  28. $table->integer('duration')->default(0)->comment('时长,单位:秒');
  29. $table->tinyInteger('comment_status')->default(0)->comment('0禁止评论,1可以评论');
  30. $table->string('subtitle_zh_path')->default('')->comment('中文字幕');
  31. $table->string('subtitle_en_path')->default('')->comment('英文字幕');
  32. $table->tinyInteger('ban_drag')->default(0)->comment('禁止拖动,0否,1是');
  33. $table->integer('sort')->default(0);
  34. $table->tinyInteger('status')->comment('1显示,0隐藏');
  35. $table->softDeletes();
  36. $table->timestamps();
  37. });
  38. }
  39. /**
  40. * Reverse the migrations.
  41. *
  42. * @return void
  43. */
  44. public function down()
  45. {
  46. Schema::dropIfExists('course_videos');
  47. }
  48. }