refactor: remove assistant chat archiving
This commit is contained in:
1 parent
26a9752206
commit
d37a2ba963
12 files changed
+8
-79
No files matched your search
@@ -407,16 +407,6 @@ export const assistantRouter = createTRPCRouter({
|
||||
.where(eq(assistantThreads.id, input.threadId));
|
||||
}),
|
||||
|
||||
setThreadStatus: protectedProcedure
|
||||
.input(z.object({ threadId: z.string().max(64), status: z.enum(["regular", "archived"]) }))
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
await ownedThreadAsync(ctx.db, input.threadId, ctx.session.user.id);
|
||||
await ctx.db
|
||||
.update(assistantThreads)
|
||||
.set({ status: input.status, updatedAt: new Date() })
|
||||
.where(eq(assistantThreads.id, input.threadId));
|
||||
}),
|
||||
|
||||
deleteThread: protectedProcedure
|
||||
.input(z.object({ threadId: z.string().max(64) }))
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
|
||||
@@ -16,7 +16,6 @@ CREATE TABLE `assistant_thread` (
|
||||
`user_id` varchar(64) NOT NULL,
|
||||
`title` varchar(256),
|
||||
`model_id` varchar(256),
|
||||
`status` varchar(16) DEFAULT 'regular' NOT NULL,
|
||||
`created_at` timestamp DEFAULT (now()) NOT NULL,
|
||||
`updated_at` timestamp DEFAULT (now()) NOT NULL,
|
||||
CONSTRAINT `assistant_thread_id` PRIMARY KEY(`id`)
|
||||
|
||||
@@ -24,7 +24,6 @@ CREATE TABLE "assistant_thread" (
|
||||
"user_id" varchar(64) NOT NULL,
|
||||
"title" varchar(256),
|
||||
"model_id" varchar(256),
|
||||
"status" varchar(16) DEFAULT 'regular' NOT NULL,
|
||||
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp DEFAULT now() NOT NULL
|
||||
);
|
||||
|
||||
@@ -25,7 +25,6 @@ CREATE TABLE `assistant_thread` (
|
||||
`user_id` text NOT NULL,
|
||||
`title` text,
|
||||
`model_id` text,
|
||||
`status` text DEFAULT 'regular' NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
|
||||
@@ -518,7 +518,6 @@ export const assistantThreads = mysqlTable(
|
||||
.references(() => users.id, { onDelete: "cascade" }),
|
||||
title: varchar({ length: 256 }),
|
||||
modelId: varchar({ length: 256 }),
|
||||
status: varchar({ length: 16 }).$type<"regular" | "archived">().notNull().default("regular"),
|
||||
createdAt: timestamp().notNull().defaultNow(),
|
||||
updatedAt: timestamp().notNull().defaultNow(),
|
||||
},
|
||||
|
||||
@@ -517,7 +517,6 @@ export const assistantThreads = pgTable(
|
||||
.references(() => users.id, { onDelete: "cascade" }),
|
||||
title: varchar({ length: 256 }),
|
||||
modelId: varchar({ length: 256 }),
|
||||
status: varchar({ length: 16 }).$type<"regular" | "archived">().notNull().default("regular"),
|
||||
createdAt: timestamp().notNull().defaultNow(),
|
||||
updatedAt: timestamp().notNull().defaultNow(),
|
||||
},
|
||||
|
||||
@@ -504,7 +504,6 @@ export const assistantThreads = sqliteTable(
|
||||
.references(() => users.id, { onDelete: "cascade" }),
|
||||
title: text(),
|
||||
modelId: text(),
|
||||
status: text().$type<"regular" | "archived">().notNull().default("regular"),
|
||||
createdAt: int({ mode: "timestamp" })
|
||||
.notNull()
|
||||
.default(sql`(unixepoch())`),
|
||||
|
||||
@@ -1999,11 +1999,7 @@
|
||||
"signIn": "Sign in to use Homarr Assistant."
|
||||
},
|
||||
"newConversation": "New conversation",
|
||||
"archivedConversation": "Archived conversation",
|
||||
"conversations": "Conversations",
|
||||
"archived": "Archived",
|
||||
"archive": "Archive",
|
||||
"restore": "Restore",
|
||||
"delete": "Delete",
|
||||
"closeHistory": "Close conversation history",
|
||||
"openHistory": "Open conversation history",
|
||||
|
||||
Reference in new issue
Block a user