Açıklama Yok

2020_04_04_005817_add_outcome_id_to_objectives_table.php 719B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class AddOutcomeIdToObjectivesTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::table('objectives', function(Blueprint $table)
  13. {
  14. $table->integer('outcome_id')->unsigned();
  15. $table->foreign('outcome_id')->references('id')->on('outcomes')->onDelete('cascade')->onUpdate('cascade');
  16. });
  17. }
  18. /**
  19. * Reverse the migrations.
  20. *
  21. * @return void
  22. */
  23. public function down()
  24. {
  25. Schema::table('objectives', function(Blueprint $table)
  26. {
  27. $table->dropForeign('objectives_outcome_id_foreign');
  28. $table->dropColumn('outcome_id');
  29. });
  30. }
  31. }