mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
only add admin config if it doesn't exist
This commit is contained in:
@@ -16,6 +16,12 @@ export async function up(knex: Knex): Promise<void> {
|
||||
.whereNotNull("id")
|
||||
.andWhere("id", "<>", ADMIN_CONFIG_UUID)
|
||||
.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> {
|
||||
|
||||
Reference in New Issue
Block a user