Skip to content

feat: track executed fixtures and add doctrine:fixtures:status - #4

Merged
brianvarskonst merged 2 commits into
mainfrom
feat/fixture-version-status
Nov 15, 2026
Merged

brianvarskonst merged 2 commits into
mainfrom
feat/fixture-version-status

Conversation

@brianvarskonst

Copy link
Copy Markdown
Member

What

Part 1 of 3 of migration-style fixtures (status → up → down).

  • FixtureVersionStorage records executed fixtures in doctrine_fixture_versions (fixture class, batch, executed at, the references the fixture set as class + identity). The table is created on first write, like doctrine_migration_versions; reads of a missing table return nothing.
  • FixtureVersionsSchemaFilter hides the table from schema introspection. SchemaFilterPass tags it for every DBAL connection (DoctrineBundle's tag defaults to the default connection only), so migrations:diff / schema:update never propose dropping it. Because the filter also hides it from tableExists(), the storage detects a missing table via TableNotFoundException instead.
  • doctrine:fixtures:status [--group] [--em] lists fixtures as pending, executed (batch, time) or unavailable (recorded but the class is gone; only without --group).
  • Requires doctrine/dbal ^4.5 for the non-deprecated schema editor API.
  • Test helpers moved to tests/Support/KernelTestCase.php (separate refactor commit).

Verification

composer qa passes 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 from SchemaTool::getUpdateSchemaSql().

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.
@brianvarskonst
brianvarskonst merged commit da4571d into main Nov 15, 2026
3 checks passed
@brianvarskonst
brianvarskonst deleted the feat/fixture-version-status branch November 15, 2026 13:34
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