2021_08_12_221232_create_course_comments_table.php 835 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateCourseCommentsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('course_comments', function (Blueprint $table) {
  15. $table->id();
  16. $table->integer('user_id');
  17. $table->integer('course_id');
  18. $table->integer('course_video_id')->default(0);
  19. $table->text('content')->nullable(true);
  20. $table->softDeletes();
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::dropIfExists('course_comments');
  32. }
  33. }