暂无描述

2021_03_29_151507_create_transformative_objective_program.php 1.0KB

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