Açıklama Yok

2021_06_05_235727_create_rubric_activity_table.php 795B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateRubricActivityTable extends Migration
  5. {
  6. public function up()
  7. {
  8. Schema::create('rubric_activity', function (Blueprint $table) {
  9. $table->increments('id');
  10. $table->integer('rubric_id')->unsigned();
  11. $table->integer('activity_id')->unsigned();
  12. $table->timestamps();
  13. $table
  14. ->foreign('rubric_id')
  15. ->references('id')
  16. ->on('rubrics')
  17. ->onDelete('cascade')
  18. ->onUpdate('cascade');
  19. $table
  20. ->foreign('activity_id')
  21. ->references('id')
  22. ->on('activities')
  23. ->onDelete('cascade')
  24. ->onUpdate('cascade');
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::drop('rubric_activity');
  35. }
  36. }