aboutsummaryrefslogtreecommitdiff
path: root/apps/web/server/db
diff options
context:
space:
mode:
authorcodetorso <[email protected]>2024-07-20 07:17:25 +0530
committercodetorso <[email protected]>2024-07-20 07:17:25 +0530
commit21fe55a96c36892fc50e8198248da825a5a4bd6f (patch)
tree83832e20adb0e4acfa529ac624e7f2b914f7a25a /apps/web/server/db
parentfix links (diff)
downloadsupermemory-torso.tar.xz
supermemory-torso.zip
for god's sake this should work ;)torso
Diffstat (limited to 'apps/web/server/db')
-rw-r--r--apps/web/server/db/schema.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/web/server/db/schema.ts b/apps/web/server/db/schema.ts
index ae293a91..8d6157e9 100644
--- a/apps/web/server/db/schema.ts
+++ b/apps/web/server/db/schema.ts
@@ -193,7 +193,8 @@ export const chatThreads = createTable(
userId: text("userId")
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
- },
+ createdAt: integer("createdAt").notNull().$defaultFn(() => Math.floor(Date.now() / 1000)), // Use Unix timestamp
+ },
(thread) => ({
userIdx: index("chatThread_user_idx").on(thread.userId),
}),