mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 10:28:00 +00:00
Merge pull request #1503 from Infisical/patch-super-user-migration
update admin config to default uuid if it doesn't exist
This commit is contained in:
@@ -16,6 +16,12 @@ export async function up(knex: Knex): Promise<void> {
|
|||||||
.whereNotNull("id")
|
.whereNotNull("id")
|
||||||
.andWhere("id", "<>", ADMIN_CONFIG_UUID)
|
.andWhere("id", "<>", ADMIN_CONFIG_UUID)
|
||||||
.limit(1);
|
.limit(1);
|
||||||
|
|
||||||
|
const superUserConfigExists = await knex(TableName.SuperAdmin).where("id", ADMIN_CONFIG_UUID).first();
|
||||||
|
|
||||||
|
if (!superUserConfigExists) {
|
||||||
|
await knex(TableName.SuperAdmin).update({ id: ADMIN_CONFIG_UUID }).whereNotNull("id").limit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function down(knex: Knex): Promise<void> {
|
export async function down(knex: Knex): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user