feat : update

This commit is contained in:
2026-10-02 17:33:14 +07:00 Unverified
parent 63898fb90d
commit a966d996a9
34 changed files with 4678 additions and 147 deletions
+8 -2
View File
@@ -1,6 +1,7 @@
import {
bigint,
boolean,
foreignKey,
index,
integer,
jsonb,
@@ -214,16 +215,21 @@ export const commissionMessages = commissionSchema.table("message", {
id: uuid("id").defaultRandom().primaryKey(),
ticketId: uuid("ticket_id").notNull().references(() => commissionTickets.id),
authorId: text("author_id").notNull().references(() => users.id),
replyToId: uuid("reply_to_id"),
text: text("text"),
imageObjectKey: text("image_object_key"),
imageMimeType: varchar("image_mime_type", { length: 32 }),
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
}, (table) => [index("commission_message_ticket_time_idx").on(table.ticketId, table.createdAt)]);
}, (table) => [
index("commission_message_ticket_time_idx").on(table.ticketId, table.createdAt),
index("commission_message_reply_idx").on(table.replyToId),
foreignKey({ columns: [table.replyToId], foreignColumns: [table.id] }).onDelete("set null"),
]);
export const commissionReactions = commissionSchema.table("reaction", {
messageId: uuid("message_id").notNull().references(() => commissionMessages.id, { onDelete: "cascade" }),
userId: text("user_id").notNull().references(() => users.id),
emoji: varchar("emoji", { length: 16 }).notNull(),
emoji: text("emoji").notNull(),
}, (table) => [primaryKey({ columns: [table.messageId, table.userId, table.emoji] })]);