diff options
| author | MohamedBassem <me@mbassem.com> | 2024-09-29 01:24:04 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-09-29 01:24:04 +0000 |
| commit | 36fb5a4c63aada8e8107b8e9d97a6ba128d13494 (patch) | |
| tree | c1bb803b55a751cf97766a0be08691c5589aef55 /packages/db/schema.ts | |
| parent | 57f5faa7b5ba7a43bb09555741a207c0113e9d62 (diff) | |
| download | karakeep-36fb5a4c63aada8e8107b8e9d97a6ba128d13494.tar.zst | |
feature(web): Add the ability to customize the inference prompts. Fixes #170
Diffstat (limited to 'packages/db/schema.ts')
| -rw-r--r-- | packages/db/schema.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/db/schema.ts b/packages/db/schema.ts index 4398523a..6514c277 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -297,6 +297,27 @@ export const bookmarksInLists = sqliteTable( }), ); + +export const customPrompts = sqliteTable( + "customPrompts", + { + id: text("id") + .notNull() + .primaryKey() + .$defaultFn(() => createId()), + text: text("text").notNull(), + enabled: integer("enabled", { mode: "boolean" }).notNull(), + appliesTo: text("attachedBy", { enum: ["all", "text", "images"] }).notNull(), + createdAt: createdAtField(), + userId: text("userId") + .notNull() + .references(() => users.id, { onDelete: "cascade" }), + }, + (bl) => ({ + userIdIdx: index("customPrompts_userId_idx").on(bl.userId), + }), +); + export const config = sqliteTable("config", { key: text("key").notNull().primaryKey(), value: text("value").notNull(), |
