123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
-
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
-
- class AddOutcomeIdToObjectivesTable extends Migration {
-
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::table('objectives', function(Blueprint $table)
- {
- $table->integer('outcome_id')->unsigned();
-
- $table->foreign('outcome_id')->references('id')->on('outcomes')->onDelete('cascade')->onUpdate('cascade');
- });
- }
-
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::table('objectives', function(Blueprint $table)
- {
- $table->dropForeign('objectives_outcome_id_foreign');
-
- $table->dropColumn('outcome_id');
- });
- }
-
- }
|