From db2d346cd6c265d8e7c69383c6de03bf5f6252f0 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sun, 6 Oct 2024 12:26:31 +0000 Subject: refactor: Include userId in the assets table --- packages/db/schema.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages/db/schema.ts') 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), }), ); -- cgit v1.2.3-70-g09d2