feat : update
This commit is contained in:
+8
-2
@@ -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] })]);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user