add:reply system

This commit is contained in:
2026-03-09 23:11:00 +09:00
parent 3c28c117a0
commit 2a81ede504
18 changed files with 772 additions and 167 deletions

View File

@@ -26,6 +26,16 @@ export const tickets = sqliteTable("tickets", {
createdAt: text("createdAt").notNull(),
});
export const ticketReplies = sqliteTable("ticket_replies", {
id: text("id").primaryKey(),
ticketId: text("ticketId").notNull().references(() => tickets.id, { onDelete: "cascade" }),
userId: text("userId").references(() => users.id, { onDelete: "set null" }),
body: text("body").notNull(),
// "user" = ticket owner or guest, "support" = another authenticated user
authorRole: text("authorRole", { enum: ["user", "support"] }).notNull().default("user"),
createdAt: text("createdAt").notNull(),
});
export const sessions = sqliteTable("sessions", {
id: text("id").primaryKey(),
data: text("data").notNull(),