refactor: tech debt batch 2 — drop dead models, stale columns, schema cleanup
Schema: - Drop 4 dead models: OverrideAction, NotificationPolicy, AssignmentException, AdvancementRule - Drop 2 dead enums: OverrideReasonCode, AdvancementRuleType - Drop 3 stale columns: Project.roundId, ConflictOfInterest.roundId, Evaluation.version - Remove 3 back-relation fields from User, Assignment, Round Code: - Fix 6 COI queries in assignment.ts + 1 in juror-reassignment.ts (roundId filter → assignment.roundId after column drop) - Remove orphaned Project.roundId write in project.ts createProject - Remove advancementRules include from round.ts getById - Remove AdvancementRule from RoundWithRelations type - Clean up seed.ts (remove advancement rule seeding) - Clean up tests/helpers.ts (remove dead model cleanup) - Add TODO comments on user delete mutations (FK violation risk) Migration: 20260308000000_drop_dead_models_and_stale_columns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -206,7 +206,10 @@ export const userRouter = router({
|
||||
})
|
||||
}
|
||||
|
||||
// Delete user
|
||||
// TODO: This delete will fail with a FK violation for any user with activity
|
||||
// (COI declarations, mentor assignments, messages, evaluations, etc.).
|
||||
// A proper purge flow with pre-deletion cleanup or soft-delete is needed
|
||||
// before hard-delete can work reliably for active users.
|
||||
await ctx.prisma.user.delete({
|
||||
where: { id: ctx.user.id },
|
||||
})
|
||||
@@ -657,6 +660,10 @@ export const userRouter = router({
|
||||
select: { email: true },
|
||||
})
|
||||
|
||||
// TODO: This delete will fail with a FK violation for any user with activity
|
||||
// (COI declarations, mentor assignments, messages, evaluations, etc.).
|
||||
// A proper purge flow with pre-deletion cleanup or soft-delete is needed
|
||||
// before hard-delete can work reliably for active users.
|
||||
const user = await ctx.prisma.user.delete({
|
||||
where: { id: input.id },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user