mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Fix parental_controls migration
This commit is contained in:
parent
61b1523368
commit
8a9a7c0e47
1 changed files with 6 additions and 2 deletions
|
@ -28,7 +28,7 @@ return new class extends Migration
|
||||||
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
|
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
|
||||||
$indexesFound = $schemaManager->listTableIndexes('user_roles');
|
$indexesFound = $schemaManager->listTableIndexes('user_roles');
|
||||||
if (array_key_exists('user_roles_profile_id_unique', $indexesFound)) {
|
if (array_key_exists('user_roles_profile_id_unique', $indexesFound)) {
|
||||||
$table->dropIndex('user_roles_profile_id_unique');
|
$table->dropUnique('user_roles_profile_id_unique');
|
||||||
}
|
}
|
||||||
$table->unsignedBigInteger('profile_id')->unique()->nullable()->index()->change();
|
$table->unsignedBigInteger('profile_id')->unique()->nullable()->index()->change();
|
||||||
});
|
});
|
||||||
|
@ -42,7 +42,11 @@ return new class extends Migration
|
||||||
Schema::dropIfExists('parental_controls');
|
Schema::dropIfExists('parental_controls');
|
||||||
|
|
||||||
Schema::table('user_roles', function (Blueprint $table) {
|
Schema::table('user_roles', function (Blueprint $table) {
|
||||||
$table->dropIndex('user_roles_profile_id_unique');
|
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
|
||||||
|
$indexesFound = $schemaManager->listTableIndexes('user_roles');
|
||||||
|
if (array_key_exists('user_roles_profile_id_unique', $indexesFound)) {
|
||||||
|
$table->dropUnique('user_roles_profile_id_unique');
|
||||||
|
}
|
||||||
$table->unsignedBigInteger('profile_id')->unique()->index()->change();
|
$table->unsignedBigInteger('profile_id')->unique()->index()->change();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue