diff options
| author | codetorso <[email protected]> | 2024-06-29 07:02:27 +0530 |
|---|---|---|
| committer | codetorso <[email protected]> | 2024-06-29 07:02:27 +0530 |
| commit | 3143baac875a19a6598100a41db06ea9b162bf3c (patch) | |
| tree | f0ccbc3b5694d321f139c87a57a5892a9055f713 /apps/web/server | |
| parent | minor error fixes (diff) | |
| download | supermemory-3143baac875a19a6598100a41db06ea9b162bf3c.tar.xz supermemory-3143baac875a19a6598100a41db06ea9b162bf3c.zip | |
User Canvas (1/2)
Diffstat (limited to 'apps/web/server')
| -rw-r--r-- | apps/web/server/db/schema.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/web/server/db/schema.ts b/apps/web/server/db/schema.ts index 69372a35..c40e50f1 100644 --- a/apps/web/server/db/schema.ts +++ b/apps/web/server/db/schema.ts @@ -198,5 +198,24 @@ export const chatHistory = createTable( }), ); +export const canvas = createTable( + "canvas", + { + id: text("id") + .notNull() + .primaryKey() + .$defaultFn(() => crypto.randomUUID()), + title: text("title").default("Untitled").notNull(), + description: text("description").default("Untitled").notNull(), + imageUrl: text("url").default("").notNull(), + userId: text("userId") + .notNull() + .references(() => users.id, { onDelete: "cascade" }), + }, + (canvas) => ({ + userIdx: index("canvas_user_userId").on(canvas.userId), + }), +); + export type ChatThread = typeof chatThreads.$inferSelect; export type ChatHistory = typeof chatHistory.$inferSelect; |