mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 05:19:49 +00:00
Add username field to users
This commit is contained in:
+4
-2
@@ -26,9 +26,11 @@ export async function up(knex: Knex): Promise<void> {
|
||||
}
|
||||
|
||||
await knex.schema.alterTable(TableName.Users, (t) => {
|
||||
t.string("username");
|
||||
t.uuid("orgId");
|
||||
t.string("username").notNullable();
|
||||
t.uuid("orgId").nullable();
|
||||
t.foreign("orgId").references("id").inTable(TableName.Organization).onDelete("CASCADE");
|
||||
t.string("email").nullable().alter();
|
||||
t.unique(["username", "orgId"]);
|
||||
});
|
||||
|
||||
await knex(TableName.Users).update("username", knex.ref("email"));
|
||||
Reference in New Issue
Block a user