aboutsummaryrefslogtreecommitdiffstats
path: root/packages/db/schema.ts
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-02-28 20:45:28 +0000
committerMohamedBassem <me@mbassem.com>2024-02-28 20:45:28 +0000
commit3208dda3848ad739f54cebf44c423e2b68e85b2d (patch)
tree25602c451354a296e8779197fdd42acab7526502 /packages/db/schema.ts
parent7096fb3941579e5c045796361745d597e03ff7fc (diff)
downloadkarakeep-3208dda3848ad739f54cebf44c423e2b68e85b2d.tar.zst
feature: Add support for storing and previewing raw notes
Diffstat (limited to 'packages/db/schema.ts')
-rw-r--r--packages/db/schema.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/db/schema.ts b/packages/db/schema.ts
index 94467c56..4acd86c4 100644
--- a/packages/db/schema.ts
+++ b/packages/db/schema.ts
@@ -125,6 +125,15 @@ export const bookmarkLinks = sqliteTable("bookmarkLinks", {
crawledAt: integer("crawledAt", { mode: "timestamp" }),
});
+export const bookmarkTexts = sqliteTable("bookmarkTexts", {
+ id: text("id")
+ .notNull()
+ .primaryKey()
+ .$defaultFn(() => createId())
+ .references(() => bookmarks.id, { onDelete: "cascade" }),
+ text: text("text"),
+});
+
export const bookmarkTags = sqliteTable(
"bookmarkTags",
{
@@ -179,6 +188,10 @@ export const bookmarkRelations = relations(bookmarks, ({ many, one }) => ({
fields: [bookmarks.id],
references: [bookmarkLinks.id],
}),
+ text: one(bookmarkTexts, {
+ fields: [bookmarks.id],
+ references: [bookmarkTexts.id],
+ }),
tagsOnBookmarks: many(tagsOnBookmarks),
}));