Start working on the profile refactoring.

This commit is contained in:
charlesgauthereau
2025-12-21 16:55:12 +01:00
parent 428782e8a4
commit 116229a29e
77 changed files with 5076 additions and 509 deletions
+2
View File
@@ -0,0 +1,2 @@
ALTER TABLE "user" ADD COLUMN "lastChangedPasswordAt" timestamp;--> statement-breakpoint
ALTER TABLE "user" ADD COLUMN "two_factor_enabled" boolean DEFAULT false;
File diff suppressed because it is too large Load Diff
+7
View File
@@ -92,6 +92,13 @@
"when": 1766308683196,
"tag": "0012_peaceful_leopardon",
"breakpoints": true
},
{
"idx": 13,
"version": "7",
"when": 1766327760039,
"tag": "0013_past_logan",
"breakpoints": true
}
]
}
+11 -2
View File
@@ -6,7 +6,7 @@ import {project} from "./06_project";
import {member, OrganizationMember} from "@/db/schema/04_member";
import {invitation} from "@/db/schema/05_invitation";
import {organization} from "@/db/schema/03_organization";
import {Account} from "better-auth";
import {Account as BetterAuthAccount} from "better-auth";
import {timestamps} from "@/db/schema/00_common";
export const user = pgTable("user", {
@@ -19,6 +19,8 @@ export const user = pgTable("user", {
banned: boolean("banned"),
banReason: text("ban_reason"),
banExpires: timestamp("ban_expires"),
lastChangedPasswordAt: timestamp(),
twoFactorEnabled: boolean("two_factor_enabled").default(false),
...timestamps
});
@@ -95,7 +97,14 @@ export const projectRelations = relations(project, ({one}) => ({
export const userSchema = createSelectSchema(user);
export type User = z.infer<typeof userSchema>;
type FixedAccount = Omit<Account, 'updatedAt'> & {
export const sessionSchema = createSelectSchema(session);
export type Session = z.infer<typeof sessionSchema>;
export const accountSchema = createSelectSchema(account);
export type Account = z.infer<typeof accountSchema>;
type FixedAccount = Omit<BetterAuthAccount, 'updatedAt'> & {
updatedAt: Date | null;
};