Fix db migration not being applied#552
Conversation
Review Summary by QodoMake database migration idempotent and retry-safe
WalkthroughsDescription• Make migration idempotent by checking schema before applying changes • Add conditional logic to skip already-applied schema modifications • Replace index creation with IF NOT EXISTS SQL statements • Add deduplication check to prevent duplicate data insertion • Guard column drops with existence checks to prevent errors Diagramflowchart LR
A["Migration Execution"] --> B["Introspect Current Schema"]
B --> C["Check Existing Columns"]
C --> D["Check Table Existence"]
D --> E["Conditionally Add Columns"]
E --> F["Conditionally Create Table"]
F --> G["Create Indexes with IF NOT EXISTS"]
G --> H["Insert Data with Deduplication"]
H --> I["Drop Columns Conditionally"]
I --> J["Migration Complete"]
File Changes1. code/backend/Cleanuparr.Persistence/Migrations/Events/20260405174732_AddSearchEventData.cs
|
Code Review by Qodo
1. AddSearchEventData missing regression test
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Relates to #551