1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
-
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
-
- class AddMappingColumnsToOutcomesTable extends Migration {
-
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::table('outcomes', function(Blueprint $table)
- {
- $table->integer('new_outcome_id')->unsigned()->nullable();
- $table->date('deactivation_date')->nullable();
-
- $table->foreign('new_outcome_id')->references('id')->on('outcomes');
- });
- }
-
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::table('outcomes', function(Blueprint $table)
- {
- $table->dropForeign(['new_outcome_id']);
-
- $table->dropColumn('deactivation_date');
- $table->dropColumn('new_outcome_id');
- });
- }
-
- }
|