1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 09:02:28 +01:00

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:
Dane Everitt 2020-12-16 20:38:21 -08:00
parent 5bbb36b3cf
commit 0084b48d86
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 4 additions and 1 deletions

View File

@ -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']);

View File

@ -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;
}