docs(rfc): define unified versioned database migrations - #1771
Open
Zxf-xufeng wants to merge 8 commits into
Open
Zxf-xufeng wants to merge 8 commits into
Zxf-xufeng wants to merge 8 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue or RFC does this PR close?
Refs #1756. Companion implementation Draft PR: #1772. The branches are independent; this documentation PR does not close implementation acceptance criteria.
Rationale for this change
PowerContext spreads schema changes across initialization, startup helpers, and maintenance commands. This RFC defines explicit upgrades of existing databases using Alembic, one standard version table, and verification before business access. It also defines the operational path for shared-database deployments and local services.
What changes are included in this PR?
Only the English and Chinese RFCs:
pc_schema_revision(version_num)with standard Alembic version handling, adding no generic run, step, or task tables. Each managed schema change provides an immutable revision; a release can contain several or none.applyplans and confirms backup/lifecycle choices, stops writers, locks and rechecks, migrates, and verifies. Multiple Servers sharing one database run one migration Job; each new node checks readiness.BackupProviderreusing backend configuration: SQLite native backup, validated seekDB whole-database fork, and OceanBase native physical backup/log archiving. Explain fork coverage, shared-storage limitations, and the required original-database restoration path.AsyncDatabase, fixed maintenance connections, frozen Alembic scripts, repositories, data batches, and versioned index rebuilds. Ordinary startup becomes inspection before runtime composition.The framework proceeds independently of #1716. Once enabled, every still-unmerged PR changing managed schema follows the standard process. The companion prototype must satisfy these acceptance criteria separately.
Are there any user-facing changes?
No runtime changes. Existing local and remote databases require explicit migration under the proposed design. Retained old API contracts can share migrated storage; API compatibility and storage compatibility remain separate commitments. Manual backup is not verified, and skipped backup may leave original data unrecoverable.
How was this change tested?
uv run --locked prek run -a, including Ruff andty check.git diff --check.A full static website build and real-database migration acceptance are not claimed by this documentation PR.
AI usage statement
Prepared and checked with OpenAI Codex (GPT-6). The RFC states design requirements, not claims of executed backend acceptance.