暫無描述

2018_08_28_141547_drop_criterion_objective_table.php 925B

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