Skip to content

Commit

Permalink
Merge pull request #96 from dbarzin/dev
Browse files Browse the repository at this point in the history
fix migration
  • Loading branch information
dbarzin authored Jul 16, 2024
2 parents 8ea513d + 15f00a9 commit a6def12
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@
*/
public function up(): void
{
Schema::table('controls', function (Blueprint $table) {
$table->dropForeign('controls_domain_id_foreign');
$table->dropForeign('controls_measure_id_foreign');
$table->dropColumn('domain_id');
$table->dropColumn('measure_id');
});

Schema::create('control_measure', function (Blueprint $table) {
$table->integer('control_id')->unsigned();
$table->foreign('control_id')->references('id')->on('controls');
Expand All @@ -31,6 +24,13 @@ public function up(): void
if (($control->measure_id !== null)&&($control->measure_id !== 0))
$control->measures()->sync([$control->measure_id]);
}

Schema::table('controls', function (Blueprint $table) {
$table->dropForeign('controls_domain_id_foreign');
$table->dropForeign('controls_measure_id_foreign');
$table->dropColumn('domain_id');
$table->dropColumn('measure_id');
});
}

/**
Expand Down

0 comments on commit a6def12

Please sign in to comment.