aboutsummaryrefslogtreecommitdiffhomepage
path: root/pkgs/server/src/db/schema.ts
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/server/src/db/schema.ts')
-rw-r--r--pkgs/server/src/db/schema.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/server/src/db/schema.ts b/pkgs/server/src/db/schema.ts
index 23f19d1..4b9631f 100644
--- a/pkgs/server/src/db/schema.ts
+++ b/pkgs/server/src/db/schema.ts
@@ -37,6 +37,18 @@ export const users = pgTable("users", {
.defaultNow(),
});
+export const refreshTokens = pgTable("refresh_tokens", {
+ id: uuid("id").primaryKey().defaultRandom(),
+ userId: uuid("user_id")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
+ tokenHash: varchar("token_hash", { length: 255 }).notNull(),
+ expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
+ createdAt: timestamp("created_at", { withTimezone: true })
+ .notNull()
+ .defaultNow(),
+});
+
export const decks = pgTable("decks", {
id: uuid("id").primaryKey().defaultRandom(),
userId: uuid("user_id")