Add transactional database migration system - #693
Closed
RANGROO wants to merge 1 commit into
Closed
Conversation
This was referenced Aug 12, 2026
Collaborator
Author
|
Superseded by consolidated draft #701, which contains this work plus the completed Oghma catalog, retrieval, knowledge-class, biography, parity, and UI changes. Please review the combined draft there. |
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.
Summary
chim_meta.schema_migrationsledger202608110000legacy baseline plus generated baseline/current schema contractsdebug/db_updates.phpas an explicit compatibility bridge and remove schema writes from normal UI/game request pathsaudit_request.responseDDL into the first raw SQL migrationBaseline transition
The compatibility repair reasserts two structures that the legacy latest-per-feature markers or process-static state can hide (
visual_contextand the prompts unique index). It also upgradeseventlog.sesstransactionally while discovering, rebuilding, and owner-preserving every dependent profile view. It refuses profile views with custom grants/options rather than silently losing them.Normal runtime requests now compare every source migration version, name, and SHA-256 checksum to the ledger. Stale or drifted databases fail closed with the operator bridge command; runtime requests do not execute DDL.
Validation
MigrationRunnerTestpassed, 4 tests / 8 assertionsdatabase_default.sql, ran frozen updater + audited repair, applied migration, verified current schema, and confirmed second migrate was a no-opeventlog.sessdependent views remained present with their owners21b9c3152e770606bd04c7b7c2817f24c80ec51fto the DwemerAI4Skyrim3 HerikaServer runtime after a 198,783,649-byte compressed backupstatus,verify, anddoctorpassed;eventlog.sessistext;audit_request.responseexistsFull-suite limits
The full PHPUnit invocation ran 261 tests / 2,635 assertions before ending non-green. It exposed the repository's existing duplicate
sqltest-class architecture and unrelated existing assertions in faction ordering and historic-context behavior. The migration-specific suite is green; this PR does not claim the entire legacy suite is green.Review / overlap
The unstable guard returned
PR_REQUIREDfor size, generated contract growth, sensitive lifecycle code, and recent/open work overlap. In particular,debug/db_updates.phpoverlaps open PRs #690, #594, and #536. This PR only freezes the file and changes theeventlog_session_payloadhandoff/removes the unversioned audit DDL; historical feature blocks are not rewritten.Deployment scope
HerikaServer only. No CHIM DLL was rebuilt or deployed. No release/version bump was made.