Skip to content

Commit

Permalink
fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarzin committed Jul 16, 2024
1 parent b42b6d1 commit 15f00a9
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 15f00a9

Please sign in to comment.