rwadurian/backend/services/contribution-service/prisma/migrations
hailin ff67319171 feat(contribution): implement transactional idempotent CDC consumer for 1.0->2.0 sync
Implements 100% exactly-once semantics for CDC events from 1.0 databases
(identity-service, planting-service, referral-service) to contribution-service.

Key changes:
- Add ProcessedCdcEvent model with (sourceTopic, offset) unique constraint
- Add withIdempotency() wrapper using Serializable transaction isolation
- Add registerTransactionalHandler() for handlers requiring idempotency
- Modify CDC handlers to accept external transaction client
- All database operations now use the passed transaction client

This ensures that:
1. Each CDC event is processed exactly once
2. Idempotency record and business logic are in the same transaction
3. Any failure causes complete rollback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 19:22:47 -08:00
..
0001_init refactor(prisma): consolidate migrations into single init files 2026-01-12 11:04:24 -08:00
0002_add_transactional_idempotency feat(contribution): implement transactional idempotent CDC consumer for 1.0->2.0 sync 2026-01-12 19:22:47 -08:00
migration_lock.toml fix(contribution-service): 修复migration为完整初始化脚本 2026-01-11 06:31:24 -08:00