Skip to content

feat(db): add migration lifecycle tooling - #723

Merged
sanohiro merged 11 commits into
mainfrom
agent/pkg-db-q5a-migrations
Aug 8, 2026
Merged

feat(db): add migration lifecycle tooling#723
sanohiro merged 11 commits into
mainfrom
agent/pkg-db-q5a-migrations

Conversation

@sanohiro

@sanohiro sanohiro commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • add the D11/Q5a migration CLI lifecycle for SQLite and PostgreSQL: migrate, status, check, and repair
  • enforce exact catalog screening, history reconciliation, dirty-state handling, operation locking, native schema validation, and fail-closed recovery
  • add SQLite and PostgreSQL owner coverage, required PostgreSQL CI, scaling measurements, and synchronized English/Japanese contract updates

This is intentionally one larger capability boundary: the catalog policy, native locking, history codec, execution state machine, and CLI are a strict producer-to-consumer chain. Splitting them would leave dormant seams and duplicate the same ownership, failure-recovery, and cross-driver proof.

Verification

  • scripts/cargo.sh test -p align_driver --test pkg_db_q5a -- --nocapture
  • scripts/pre-pr.sh --base origin/main --reviewer codex-review --review-log .git/align-review-q5a-8a66fbf2.log --findings-fixed --owner-test pkg_db_q5a -- scripts/cargo.sh test -p align_driver --test pkg_db_q5a -- --nocapture
  • required PostgreSQL Q5a job added to CI; local PostgreSQL owner skipped because ALIGN_DB_POSTGRES_URL is not set

Review

The pre-open full-diff review found two correctness issues: SQLite token-free trailing bytes were rejected, and unchanged Forbidden history was rewritten destructively. The fix ignores token-free tails, updates unchanged Applying rows in place for both adapters, restores only changed/missing snapshots, and rejects SQLite inbound foreign keys before a restore can cascade.

@sanohiro
sanohiro marked this pull request as ready for review August 8, 2026 19:15
@sanohiro
sanohiro merged commit 275e5f7 into main Aug 8, 2026
6 of 7 checks passed
@sanohiro
sanohiro deleted the agent/pkg-db-q5a-migrations branch August 8, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant