Repository navigation
feat: track executed fixtures and add doctrine:fixtures:status - #4
Merged
Merged
Conversation
Executed fixtures are recorded in doctrine_fixture_versions (batch, time and the references they set), created on first write like the migrations table. A schema asset filter on every connection hides the table from schema diffs. doctrine:fixtures:status lists executed, pending and unavailable fixtures. Requires doctrine/dbal 4.5 for the schema editor API.
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.
What
Part 1 of 3 of migration-style fixtures (
status→up→down).FixtureVersionStoragerecords executed fixtures indoctrine_fixture_versions(fixture class, batch, executed at, the references the fixture set as class + identity). The table is created on first write, likedoctrine_migration_versions; reads of a missing table return nothing.FixtureVersionsSchemaFilterhides the table from schema introspection.SchemaFilterPasstags it for every DBAL connection (DoctrineBundle's tag defaults to the default connection only), somigrations:diff/schema:updatenever propose dropping it. Because the filter also hides it fromtableExists(), the storage detects a missing table viaTableNotFoundExceptioninstead.doctrine:fixtures:status [--group] [--em]lists fixtures aspending,executed(batch, time) orunavailable(recorded but the class is gone; only without--group).doctrine/dbal^4.5 for the non-deprecated schema editor API.tests/Support/KernelTestCase.php(separate refactor commit).Verification
composer qapasses locally on PHP 8.5 (8 tests, 62 assertions): status output for pending/executed/unavailable and--group, stored references round-trip, next batch, removal, and the tracking table missing fromSchemaTool::getUpdateSchemaSql().