From 36fb5a4c63aada8e8107b8e9d97a6ba128d13494 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sun, 29 Sep 2024 01:24:04 +0000 Subject: feature(web): Add the ability to customize the inference prompts. Fixes #170 --- packages/db/schema.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'packages/db/schema.ts') 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(), -- cgit v1.2.3-70-g09d2