fix: atomic upsert for import runs (Issue #12)
Replace check-then-insert race condition with INSERT ON CONFLICT. - upsert_pending uses RETURNING id for atomic upsert - UNIQUE(source_id, content_hash) constraint from migration 6 - blocklist_import_workflow updated to use upsert_pending - test_import_source_success fixed for async mock patterns Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -121,6 +121,7 @@ rm bangui.db bangui.db-wal bangui.db-shm
|
||||
| 6 | Add import_runs table for idempotent imports |
|
||||
| 7 | Add indexes to import_log |
|
||||
| 8 | Migrate import_log.timestamp TEXT→INTEGER UNIX |
|
||||
| 9 | Change import_log.source_id FK to ON DELETE RESTRICT |
|
||||
|
||||
## Adding New Migrations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user