Brak opisu

2020_04_22_095649_create_new_criterion_rubric_table.php 856B

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