diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-05-24 12:59:43 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-05-24 12:59:43 +0000 |
| commit | 09652176f97f11bc06f4c9b57a448e14744eac12 (patch) | |
| tree | 5205f65bdef233328a7b4af010667c5b8c25f285 /packages/db/schema.ts | |
| parent | 5f3fe5d1a1ad0abd2890283cbff45086cbfa442e (diff) | |
| download | karakeep-09652176f97f11bc06f4c9b57a448e14744eac12.tar.zst | |
feat: Allow defaulting to reader mode when clicking on bookmarks. Fixes #662
Diffstat (limited to 'packages/db/schema.ts')
| -rw-r--r-- | packages/db/schema.ts | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/packages/db/schema.ts b/packages/db/schema.ts index b5938989..0e8167c7 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -527,13 +527,27 @@ export const ruleEngineActionsTable = sqliteTable( ], ); +export const userSettings = sqliteTable("userSettings", { + userId: text("userId") + .notNull() + .primaryKey() + .references(() => users.id, { onDelete: "cascade" }), + bookmarkClickAction: text("bookmarkClickAction", { + enum: ["open_original_link", "expand_bookmark_preview"], + }).notNull().default("open_original_link"), +}); + // Relations -export const userRelations = relations(users, ({ many }) => ({ +export const userRelations = relations(users, ({ many, one }) => ({ tags: many(bookmarkTags), bookmarks: many(bookmarks), webhooks: many(webhooksTable), rules: many(ruleEngineRulesTable), + settings: one(userSettings, { + fields: [users.id], + references: [userSettings.userId], + }), })); export const bookmarkRelations = relations(bookmarks, ({ many, one }) => ({ @@ -668,3 +682,10 @@ export const rssFeedImportsTableRelations = relations( }), }), ); + +export const userSettingsRelations = relations(userSettings, ({ one }) => ({ + user: one(users, { + fields: [userSettings.userId], + references: [users.id], + }), +})); |
