Merge pull request #4508 from Infisical/feat/ENG-3666

Allow users to change the email of their accounts
This commit is contained in:
carlosmonastyrski
2025-09-11 12:36:02 -03:00
committed by GitHub
18 changed files with 545 additions and 6 deletions
@@ -0,0 +1,23 @@
import { Knex } from "knex";
import { TableName } from "../schemas";
export async function up(knex: Knex): Promise<void> {
const hasPayloadCol = await knex.schema.hasColumn(TableName.AuthTokens, "payload");
if (!hasPayloadCol) {
await knex.schema.alterTable(TableName.AuthTokens, (t) => {
t.text("payload").nullable();
});
}
}
export async function down(knex: Knex): Promise<void> {
const hasPayloadCol = await knex.schema.hasColumn(TableName.AuthTokens, "payload");
if (hasPayloadCol) {
await knex.schema.alterTable(TableName.AuthTokens, (t) => {
t.dropColumn("payload");
});
}
}
+2 -1
View File
@@ -18,7 +18,8 @@ export const AuthTokensSchema = z.object({
updatedAt: z.date(),
userId: z.string().uuid().nullable().optional(),
orgId: z.string().uuid().nullable().optional(),
aliasId: z.string().nullable().optional()
aliasId: z.string().nullable().optional(),
payload: z.string().nullable().optional()
});
export type TAuthTokens = z.infer<typeof AuthTokensSchema>;