hackzilla/doctrine-migration-pruner-bundle
A Symfony bundle that keeps your Doctrine migrations directory tidy by pruning old, already-applied migration files. Reduce clutter, speed up deployments, and keep version history manageable with simple configuration and safe defaults.
Architecture fit — poor, and there is a category error to resolve first. The package is a Symfony bundle (*Bundle suffix, depends on symfony/framework-bundle, registered via bundles.php), not a Laravel package. Laravel has no bundle abstraction; its closest analogue is a service provider registered in config/app.php/bootstrap/providers.php. More importantly, Laravel does not use Doctrine migrations: it ships its own migrator over database/migrations/*.php with a migrations table. Doctrine appears in a typical Laravel app only as doctrine/dbal for column introspection. So the package's core value proposition — pruning doctrine_migration_versions-tracked files — addresses a problem that most Laravel codebases do not have.
Integration feasibility — low as-is, moderate as a port. The underlying logic (given a baseline/squashed migration, delete migration files whose versions are already applied and superseded) is small and stack-agnostic. Reimplementing it as an Artisan command against Laravel's migrations table and database/migrations directory is likely 100–200 LOC plus tests. Installing the bundle itself in Laravel is not feasible without a compatibility shim for Symfony's DI container, console wiring, and bundle extension conventions — effort that vastly exceeds the value.
Technical risk — low blast radius, high relevance risk. The code is small and MIT-licensed, so the worst case is a wasted evaluation. The real risks are: (1) single-maintainer abandonment — 2 stars, 0 dependents, no downstream validation, no observable security disclosure process; (2) destructive semantics — a pruner deletes files from the repository, which is irreversible in the working tree and can break migrate:rollback, fresh-install determinism, and any environment that has not yet applied the pruned versions; (3) version drift — Symfony 4/5-era constraint sets may not resolve against current PHP 8.3+/Symfony 7 stacks.
Key questions to answer before any work:
doctrine/migrations via a third-party bridge)? If not, the package is out of scope by definition.migrate runtime, CI schema-build time, or diff noise? Quantify before evaluating any tool.Stack fit. In a Laravel context, the only defensible options are (a) do not adopt, and solve migration-directory bloat with a squashed baseline plus Laravel's native schema:dump --prune, which is the first-party equivalent and already ships with the framework; (b) port the concept to an Artisan command if native tooling is insufficient; (c) adopt Doctrine migrations wholesale via a third-party Laravel-Doctrine bridge — a large architectural commitment justified only if the team is already Doctrine-centric.
Migration path. None exists in the conventional sense; there is no Laravel-to-bundle upgrade path. If option (b) is chosen, treat it as greenfield: a new migrations:prune command, a dry-run default, a --force flag, and a config entry for the baseline migration name.
Compatibility. If a Symfony target is confirmed, verify composer.json requires against the project's PHP, symfony/framework-bundle, and doctrine/doctrine-migrations-bundle versions before committing. Expect to pin or patch constraints. If no maintained release supports the current stack, that alone disqualifies it.
Sequencing.
migrate duration, CI schema-build time.schema:dump --prune for Laravel; doctrine:migrations:diff consolidation for Symfony).Maintenance. Adopting the bundle means owning the dependency: no release cadence, no issue triage, no compatibility patches. Budget for a vendored fork or an internal port. A port, by contrast, is a small internal utility the team can maintain indefinitely — the better ownership model.
Support. GitHub issues only, with a two-star, zero-dependent project. There is no vendor, no SLA, and effectively no community backstop; escalation path is "read the source." Acceptable for a dev-tooling convenience, unacceptable for anything touching production schema lifecycle.
Scaling. The benefit scales linearly with migration count and is real: pruning shrinks migrate and diff runtime, cuts CI schema-build time, and reduces merge conflicts in the migrations directory. It does nothing for query performance or runtime scaling. The risk scales the same way — the more environments and branches you have, the higher the chance one of them depends on a pruned file.
Failure modes.
doctrine_migration_versions/migrations rows, causing migrate to report "already applied" for versions with no file, or to re-run nothing where it should.rollback/migrate:refresh after the pruned migration's down-path is gone.Ramp-up. Low technical ramp-up — the concept and likely the codebase are small, and a competent PHP engineer can fully read it in under an hour. The organizational ramp-up is the real cost: the team must internalize that migration files are now treated as disposable artifacts, which changes code review norms, branch hygiene, and the deploy runbook. That change management, not the code, is the dominant effort.
Recommendation. Do not adopt this package in a Laravel codebase. Use Laravel's native schema:dump --prune and a periodic squashed baseline; that closes most of the gap with zero third-party risk. Revisit only if the target is confirmed to be Symfony and Doctrine migrations are in active use — in that case the fit improves materially, but the 2-star/0-dependent profile still warrants pinning the version and vendoring the source. The high opportunity score against a near-zero adoption score is best read as "the problem space is underserved," which argues for building a thin internal utility rather than buying an unmaintained one.
How can I help you explore Laravel packages today?