Add the unique constraint a duplicate-row bug keeps proving is missing
A duplicate-row bug fixed at the schema rather than in the application for the fourth time.
The ticket
Add the unique constraint that prevents a recurring duplicate-row bug.
Acceptance criteria
- Existing duplicates are reported and resolved before the constraint is added
- The resolution rule for duplicates is agreed and recorded
- The constraint is added without an unacceptable lock
- A test asserts a duplicate insert is now refused
What lands as proof
The duplicate report, the resolution, and a test proving the second insert is refused.
Why teams defer it
- Deciding which of two duplicate rows to keep is a product decision, not a database one.
- Every occurrence gets cleaned up individually, which keeps the underlying gap out of the backlog.
Questions
- What does the agent actually change?
- The ticket is scoped to one outcome: add the unique constraint that prevents a recurring duplicate-row bug. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.
- How do I know the work is done?
- The pull request carries the evidence, not only the diff. Here that means duplicates reported and resolved first, then the constraint holds, so a reviewer can confirm the result without reproducing the work locally.
- How much oversight does this need?
- The run stops for the plan, and the review bar is raised afterwards so that smaller suggestions block the merge too, not only serious findings.