forked from Alex/Pterodactyl-Panel
quick migration changes for refresh(ish) support; ref #2875
This still fails in a 2017 migration, but I don't care.
This commit is contained in:
parent
5bbb36b3cf
commit
0084b48d86
@ -30,6 +30,8 @@ class FixUniqueIndexToAccountForHost extends Migration
|
||||
public function down()
|
||||
{
|
||||
Schema::table('databases', function (Blueprint $table) {
|
||||
$table->dropForeign(['database_host_id']);
|
||||
|
||||
$table->dropUnique(['database_host_id', 'database']);
|
||||
$table->dropUnique(['database_host_id', 'username']);
|
||||
|
||||
|
@ -108,7 +108,8 @@ class MergePermissionsTableIntoSubusers extends Migration
|
||||
foreach (DB::select('SELECT id, permissions FROM subusers') as $datum) {
|
||||
$values = [];
|
||||
foreach (json_decode($datum->permissions, true) as $permission) {
|
||||
if (! empty($v = $flipped[$permission])) {
|
||||
$v = $flipped[$permission] ?? null;
|
||||
if (! empty($v)) {
|
||||
$values[] = $datum->id;
|
||||
$values[] = $v;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user