mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 14:34:44 +02: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:
parent
5bbb36b3cf
commit
0084b48d86
@ -30,6 +30,8 @@ class FixUniqueIndexToAccountForHost extends Migration
|
|||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('databases', function (Blueprint $table) {
|
Schema::table('databases', function (Blueprint $table) {
|
||||||
|
$table->dropForeign(['database_host_id']);
|
||||||
|
|
||||||
$table->dropUnique(['database_host_id', 'database']);
|
$table->dropUnique(['database_host_id', 'database']);
|
||||||
$table->dropUnique(['database_host_id', 'username']);
|
$table->dropUnique(['database_host_id', 'username']);
|
||||||
|
|
||||||
|
@ -108,7 +108,8 @@ class MergePermissionsTableIntoSubusers extends Migration
|
|||||||
foreach (DB::select('SELECT id, permissions FROM subusers') as $datum) {
|
foreach (DB::select('SELECT id, permissions FROM subusers') as $datum) {
|
||||||
$values = [];
|
$values = [];
|
||||||
foreach (json_decode($datum->permissions, true) as $permission) {
|
foreach (json_decode($datum->permissions, true) as $permission) {
|
||||||
if (! empty($v = $flipped[$permission])) {
|
$v = $flipped[$permission] ?? null;
|
||||||
|
if (! empty($v)) {
|
||||||
$values[] = $datum->id;
|
$values[] = $datum->id;
|
||||||
$values[] = $v;
|
$values[] = $v;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user