Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Update username migration file

Tuan Dang163ccd6cdb1f
diff --git a/backend/src/db/migrations/20240305165532_ldap-config.ts b/backend/src/db/migrations/20240305165532_ldap-config.ts
index 8f30c062f2..98397a249a 100644
--- a/backend/src/db/migrations/20240305165532_ldap-config.ts
+++ b/backend/src/db/migrations/20240305165532_ldap-config.ts
@@ -45,11 +45,15 @@ export async function up(knex: Knex): Promise<void> {
await createOnUpdateTrigger(knex, TableName.UserAliases);
await knex.schema.alterTable(TableName.Users, (t) => {
- t.string("username").unique().notNullable();
+ t.string("username").unique();
t.string("email").nullable().alter();
});
await knex(TableName.Users).update("username", knex.ref("email"));
+
+ await knex.schema.alterTable(TableName.Users, (t) => {
+ t.string("username").notNullable().alter();
+ });
}
export async function down(knex: Knex): Promise<void> {