Ingen beskrivning

2020_11_06_011242_changeCriteriaObjOutcome.php 928B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Support\Facades\Schema;
  5. class ChangeCriteriaObjOutcome extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::table('criterion_objective_outcome', function (Blueprint $table) {
  15. //$table->dropForeign('criterion_objective_outcome_objective_id_foreign');
  16. //$table->dropForeign('criterion_objective_outcome_outcome_id_foreign');
  17. //$table->integer('objective_outcome_id');
  18. DB::statement("ALTER TABLE `criterion_objective_outcome` CHANGE COLUMN `objective_outcome_id` `objective_outcome_id` INT(10) UNSIGNED NOT NULL");
  19. $table->foreign('objective_outcome_id')->references('id')->on('objective_outcome')->onDelete('cascade')->onUpdate('cascade');
  20. });
  21. }
  22. /**
  23. * Reverse the migrations.
  24. *
  25. * @return void
  26. */
  27. public function down()
  28. {
  29. //
  30. }
  31. }