No Description

2020_12_10_175517_createProgramCriterion2.php 864B

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