Data And Migration Audit
Definition
Confirm production data can survive the release. Schema, transaction, migration, backup, and rollback choices must protect correctness and recoverability.
Questions To Ask
- What data changes are included in this release?
- Which constraints and invariants must the database enforce?
- Are migrations backward-compatible with currently deployed code?
- What backup and restore evidence exists?
- What data-loss or partial-write risks remain?
Existing Project Comparison
- Inspect schema files, migrations, data access code, transactions, seed data, rollback notes, backups, and restore procedures.
- Compare data invariants against business rules and tests.
- Check migration ordering, locking, idempotency, and compatibility with rolling deploys.
Suggestive Plan
- List schema, migration, and data behavior changes.
- Inspect constraints, indexes, transactions, and owner modules.
- Verify migration apply, rollback, backup, and restore evidence.
- Identify data-loss, compatibility, and concurrency risks.
- Update
PRODUCTION_READINESS.md.
Example
For adding invoice numbers, verify uniqueness constraints, backfill safety, concurrent creation behavior, rollback effect, and restore procedure.
Vocabulary
- Invariant: rule that must always remain true.
- Backfill: migration that populates existing data.
- Compatibility: ability of old and new code/data to coexist safely.
- Restore test: proof that backup data can be recovered.
Expected Outcome
Produce a data audit with migration evidence, constraints, transaction risks, compatibility notes, backup and restore status, blockers, and accepted risks.
1---2name: data-migration-audit3description: Audit data and migration readiness before production. Use when checking schema constraints, transactions, migration safety, compatibility, backups, restore tests, data-loss risks, and rollback implications.4---56# Data And Migration Audit78## Definition910Confirm production data can survive the release. Schema, transaction, migration, backup, and rollback choices must protect correctness and recoverability.1112## Questions To Ask1314- What data changes are included in this release?15- Which constraints and invariants must the database enforce?16- Are migrations backward-compatible with currently deployed code?17- What backup and restore evidence exists?18- What data-loss or partial-write risks remain?1920## Existing Project Comparison2122- Inspect schema files, migrations, data access code, transactions, seed data, rollback notes, backups, and restore procedures.23- Compare data invariants against business rules and tests.24- Check migration ordering, locking, idempotency, and compatibility with rolling deploys.2526## Suggestive Plan27281. List schema, migration, and data behavior changes.292. Inspect constraints, indexes, transactions, and owner modules.303. Verify migration apply, rollback, backup, and restore evidence.314. Identify data-loss, compatibility, and concurrency risks.325. Update `PRODUCTION_READINESS.md`.3334## Example3536For adding invoice numbers, verify uniqueness constraints, backfill safety, concurrent creation behavior, rollback effect, and restore procedure.3738## Vocabulary3940- Invariant: rule that must always remain true.41- Backfill: migration that populates existing data.42- Compatibility: ability of old and new code/data to coexist safely.43- Restore test: proof that backup data can be recovered.4445## Expected Outcome4647Produce a data audit with migration evidence, constraints, transaction risks, compatibility notes, backup and restore status, blockers, and accepted risks.