mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: update user and authentication schema with two-factor support
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import {
|
||||
boolean,
|
||||
integer,
|
||||
pgTable,
|
||||
text,
|
||||
integer,
|
||||
timestamp,
|
||||
boolean,
|
||||
} from "drizzle-orm/pg-core";
|
||||
|
||||
export const users_temp = pgTable("users_temp", {
|
||||
@@ -14,6 +14,7 @@ export const users_temp = pgTable("users_temp", {
|
||||
image: text("image"),
|
||||
createdAt: timestamp("created_at").notNull(),
|
||||
updatedAt: timestamp("updated_at").notNull(),
|
||||
twoFactorEnabled: boolean("two_factor_enabled"),
|
||||
role: text("role").notNull(),
|
||||
ownerId: text("owner_id").notNull(),
|
||||
});
|
||||
@@ -59,6 +60,15 @@ export const verification = pgTable("verification", {
|
||||
updatedAt: timestamp("updated_at"),
|
||||
});
|
||||
|
||||
export const twoFactor = pgTable("two_factor", {
|
||||
id: text("id").primaryKey(),
|
||||
secret: text("secret").notNull(),
|
||||
backupCodes: text("backup_codes").notNull(),
|
||||
userId: text("user_id")
|
||||
.notNull()
|
||||
.references(() => users_temp.id, { onDelete: "cascade" }),
|
||||
});
|
||||
|
||||
export const organization = pgTable("organization", {
|
||||
id: text("id").primaryKey(),
|
||||
name: text("name").notNull(),
|
||||
|
||||
Reference in New Issue
Block a user