Без опису

2016_05_26_092328_create_criterion_objective_table.php 918B

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