Deduplicate history_entries before adding unique index #30

Merged
arne merged 1 commit from fix-history-dedup-migration into main 2026-04-06 20:05:57 +02:00
Owner

Summary

  • Fix migration crash on production: existing duplicate (project_id, pr_number) rows from webhook redelivery prevented CREATE UNIQUE INDEX
  • Dedup step keeps the oldest row per pair before creating the index

Test plan

  • All tests pass (go test ./...)
  • Deployed to production — service started successfully, backfilled 3 entries

🤖 Generated with Claude Code

## Summary - Fix migration crash on production: existing duplicate `(project_id, pr_number)` rows from webhook redelivery prevented `CREATE UNIQUE INDEX` - Dedup step keeps the oldest row per pair before creating the index ## Test plan - [x] All tests pass (`go test ./...`) - [x] Deployed to production — service started successfully, backfilled 3 entries 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The production database had duplicate (project_id, pr_number) rows from
webhook redelivery, causing the CREATE UNIQUE INDEX migration to fail.
Clean up duplicates (keeping the oldest row) before creating the index.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
arne merged commit ffcaa37207 into main 2026-04-06 20:05:57 +02:00
arne deleted branch fix-history-dedup-migration 2026-04-06 20:05:57 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
arne/orbit!30
No description provided.