Skip to content

Commit

Permalink
fix: drop unique key on type column before dropping key
Browse files Browse the repository at this point in the history
  • Loading branch information
sampoyigi committed Jul 16, 2020
1 parent 435fa25 commit d8801a6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public function up()
DB::table('extensions')->where('type', '!=', 'module')->delete();

Schema::table('extensions', function (Blueprint $table) {
$table->dropUnique('type');
$table->unique('name');
$table->dropColumn(['type', 'data', 'serialized', 'status', 'title']);
});
}
Expand Down Expand Up @@ -62,7 +64,6 @@ protected function copyRecordsFromExtensionsToPayments()
return;

DB::table('extensions')->where('type', 'payment')->get()->each(function ($model) {

$code = str_replace(['-', '_'], '', $model->name);
DB::table('payments')->insert([
'name' => $model->title,
Expand All @@ -76,4 +77,4 @@ protected function copyRecordsFromExtensionsToPayments()
]);
});
}
}
}

0 comments on commit d8801a6

Please sign in to comment.