fix: add onDelete set null to reviewedBy FK

This commit is contained in:
2026-04-30 19:14:45 +08:00
parent 4e324fa6e0
commit 4c0284ef9e
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -31,7 +31,9 @@ export const communitySuggestions = pgTable(
proposedValue: text("proposed_value").notNull(), // proposed new value
reason: text("reason"), // optional explanation
status: suggestionStatusEnum("status").default("pending").notNull(),
reviewedBy: text("reviewed_by").references(() => user.id),
reviewedBy: text("reviewed_by").references(() => user.id, {
onDelete: "set null",
}),
reviewedAt: timestamp("reviewed_at"),
reviewNote: text("review_note"), // reviewer's note
createdAt: timestamp("created_at").defaultNow().notNull(),