Repository navigation
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Use stable filename identities and historical table-name literals, decoupling migrations from application table classes and Composer mappings. Update generators, provider wiring, documentation, and regression coverage; document contextual binding formatting.
Support native and legacy column renames, preserve foreign-key identity across prefix changes, and report logical constraint names in drift errors. Add older-server CI coverage, migration regressions, and usage documentation.
Documentation previewReview this documentation update Updated for commit |
This branch was successfully 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.
Foundation Database now uses Doctrine DBAL for queries, execution, and schema inspection. Applications inject their tables for ordinary work and the shared connection for transaction boundaries. Schema migrations and application database locks are separate packages, so projects can install the capabilities they need.
foundation-databasesupplies the shared WordPress connection, table conveniences, naming policy, and managed transactions. DBAL^4.4replaces the wpdb/dbDelta implementation and duplicate query/schema APIs. Database owns the DBAL dependency constraint.foundation-migrationsowns declarative schema changes, discovery, history, migration stubs, and the WP-CLI migration command. RegisterDatabaseProviderfollowed byMigrationsProvider; registerWPCliProviderto expose commands, or injectMigratorfor programmatic upgrades.foundation-lock-databasesupplies application lock storage andDatabaseLock. Applications explicitly select theirLockimplementation and initialize its storage. Migration execution uses the database session's advisory lock, independently of application lock storage.Migration files now return anonymous subclasses of
Migrationand live indb/migrationsby default. For example,20260923000001_create_reports_table.phpsupplies its persistent ID through the filename. Discovery includes subfolders and globally orders IDs; adding a migration requires no Composer mapping or provider-list edit. Historical declarations use literal unprefixed table names, keeping them independent of runtime table classes and PHP namespace changes.migrations.path, relative tofoundation.root. Override ledger naming throughmigrations.table; the default derives from the application's stablefoundation.prefix.make:database:table Reports --table-name=your_plugin_reports --migrationfor a table and its initial migration. Usemake:database:migration add_status --table=your_plugin_reportsfor a later alteration. Generator names use colon-separated groups throughout the CLI.MigratesData::migrate(DataMigrationContext $context). The context exposes public readonly$dband$namesproperties plusquotedTable()for historical SQL. Foundation supplies the shared services after schema execution and before recording history.MigrationException, while preserving specific contention, interruption, incompatible-schema, and ledger failures for application recovery decisions.The guides now cover package selection, complete create-and-alter workflows, standalone-plugin resource prefixes, Strauss handling of migration files, and supported inheritance contracts. Runtime packages belong in Composer
require; the generation CLI belongs inrequire-dev. Standalone plugin archives should use split packages and production dependencies: the aggregate package includes the CLI, and a runtime package installed only through development tooling disappears with--no-dev.WP-CLI's base
Commandalso providesclearRuntimeCache()for long-running batch commands, clearing saved queries and supported runtime object caches while preserving persistent cache entries.Suggested review order:
src/Database/Table/Table.php,src/Migrations/stubs/,src/Migrations/DataMigrationContext.php, the three package providers,src/Migrations/Migrator.php,src/Migrations/Schema/SchemaPlanner.php, thensrc/Database/Connection/. The architecture review covered responsibility ownership, operational invariants, and public extension boundaries. Experiment code and research artifacts remain outside this PR.Validation on the current working tree before commit:
composer test:coverage: all six SLIC suites passed, covering 710 tests with three existing skips. This includes real Redis, WordPress integration, and WP-CLI execution.composer analyze,composer lint, the Node 24 documentation build, and diff checks passed.MySQL DDL remains nontransactional, data callbacks must be safe to retry, and all migration participants must reach the same primary database server. DBAL-specific schema translation stays internal for future Rector/DBAL 3 work; Foundation 2.0 targets PHP 8.3 and DBAL 4.4. Portal adoption remains a separate follow-up.
Summary by CodeRabbit
New Features
Documentation
Breaking Changes