Update database schema and add signup_date, last_login, and role columns to user table
This commit is contained in:
@@ -28,6 +28,15 @@ export const userTable = pgTable("user", {
|
||||
last_name: text("last_name").notNull(),
|
||||
icon: text("icon"),
|
||||
hashed_password: varchar("hashed_password").notNull(),
|
||||
signup_date: timestamp("signup_date", {
|
||||
withTimezone: true,
|
||||
mode: "date",
|
||||
}).notNull(),
|
||||
last_login: timestamp("last_login", {
|
||||
withTimezone: true,
|
||||
mode: "date",
|
||||
}),
|
||||
role: text("role").notNull(),
|
||||
});
|
||||
|
||||
// export type SelectUser = typeof userTable.$inferSelect;
|
||||
|
||||
@@ -20,6 +20,9 @@ export const lucia = new Lucia(adapter, {
|
||||
first_name: attributes.first_name,
|
||||
last_name: attributes.last_name,
|
||||
icon: attributes.icon,
|
||||
signup_date: attributes.signup_date,
|
||||
last_login: attributes.last_login,
|
||||
role: attributes.role,
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -38,4 +41,7 @@ export interface DatabaseUser {
|
||||
last_name: string;
|
||||
icon: string;
|
||||
hashed_password: string;
|
||||
signup_date: Date;
|
||||
last_login: Date;
|
||||
role: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user