2021_08_12_221205_create_course_attaches_table.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateCourseAttachesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('course_attaches', function (Blueprint $table) {
  15. $table->id();
  16. $table->integer('course_id')->default(0);
  17. $table->integer('course_video_id')->default(0);
  18. $table->string('name')->default('')->comment('附件名');
  19. $table->string('path', 500)->default('')->comment('路径');
  20. $table->string('disk', 12)->default('')->comment('存储磁盘');
  21. $table->integer('size')->default(0)->comment('单位:byte');
  22. $table->string('extension', 12)->default('')->comment('文件格式');
  23. $table->integer('download_times')->default(0)->comment('下载次数');
  24. $table->integer('sort')->default(0);
  25. $table->tinyInteger('status')->default(1)->comment('是否显示,1显示,0不显示');
  26. $table->softDeletes();
  27. $table->timestamps();
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('course_attaches');
  38. }
  39. }