Skip to content

Commit 0084b48

Browse files
committed
quick migration changes for refresh(ish) support; ref pterodactyl#2875
This still fails in a 2017 migration, but I don't care.
1 parent 5bbb36b commit 0084b48

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

database/migrations/2019_03_02_151321_fix_unique_index_to_account_for_host.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public function up()
3030
public function down()
3131
{
3232
Schema::table('databases', function (Blueprint $table) {
33+
$table->dropForeign(['database_host_id']);
34+
3335
$table->dropUnique(['database_host_id', 'database']);
3436
$table->dropUnique(['database_host_id', 'username']);
3537

database/migrations/2020_03_22_163911_merge_permissions_table_into_subusers.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public function down()
108108
foreach (DB::select('SELECT id, permissions FROM subusers') as $datum) {
109109
$values = [];
110110
foreach (json_decode($datum->permissions, true) as $permission) {
111-
if (! empty($v = $flipped[$permission])) {
111+
$v = $flipped[$permission] ?? null;
112+
if (! empty($v)) {
112113
$values[] = $datum->id;
113114
$values[] = $v;
114115
}

0 commit comments

Comments
 (0)