Нема описа

2020_05_15_123902_add_mapping_columns_to_outcomes_table.php 778B

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