aboutsummaryrefslogtreecommitdiffstats
path: root/packages/db/schema.ts
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-10-06 12:26:31 +0000
committerMohamedBassem <me@mbassem.com>2024-10-06 12:26:31 +0000
commitdb2d346cd6c265d8e7c69383c6de03bf5f6252f0 (patch)
treebe8a7987190c292d96a52c8a84f83cb3566801e6 /packages/db/schema.ts
parente6d4ff9e9c5e3de8cd2a4abf8195e2e40d21317e (diff)
downloadkarakeep-db2d346cd6c265d8e7c69383c6de03bf5f6252f0.tar.zst
refactor: Include userId in the assets table
Diffstat (limited to 'packages/db/schema.ts')
-rw-r--r--packages/db/schema.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/db/schema.ts b/packages/db/schema.ts
index f4a2ee75..c11f3b92 100644
--- a/packages/db/schema.ts
+++ b/packages/db/schema.ts
@@ -181,11 +181,15 @@ export const assets = sqliteTable(
bookmarkId: text("bookmarkId")
.notNull()
.references(() => bookmarks.id, { onDelete: "cascade" }),
+ userId: text("userId")
+ .notNull()
+ .references(() => users.id, { onDelete: "cascade" }),
},
(tb) => ({
bookmarkIdIdx: index("assets_bookmarkId_idx").on(tb.bookmarkId),
assetTypeIdx: index("assets_assetType_idx").on(tb.assetType),
+ userIdIdx: index("assets_userId_idx").on(tb.userId),
}),
);