Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine Migration Pruner Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  1. Is the target codebase actually Laravel, or is a Symfony service in scope that was mislabeled in the request? If Symfony, re-evaluate immediately — the fit flips to good.
  2. Does the team run Doctrine migrations anywhere (e.g., a Laravel app using doctrine/migrations via a third-party bridge)? If not, the package is out of scope by definition.
  3. What is the observed pain? Migration file count, migrate runtime, CI schema-build time, or diff noise? Quantify before evaluating any tool.
  4. Are all target environments (prod, staging, ephemeral preview DBs, new hires' local) at the same migration version? Pruning is only safe when the pruned versions are applied everywhere and a squashed baseline exists.
  5. What is the rollback story if a prune deletes a migration still needed by a lagging environment?

Integration Approach

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.

  1. Confirm framework (Laravel vs. Symfony) and whether Doctrine migrations are in use — one hour, decides everything.
  2. Measure the actual problem: file count, migrate duration, CI schema-build time.
  3. Benchmark against the first-party alternative (schema:dump --prune for Laravel; doctrine:migrations:diff consolidation for Symfony).
  4. If a gap remains, prototype the prune command behind a dry-run, with tests asserting that fresh-install schema is byte-identical pre/post-prune.
  5. Pilot in CI and one non-production environment; gate production use behind a documented runbook.

Operational Impact

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.

  • Deleting a migration still required by a lagging environment, producing an incomplete schema on a fresh install.
  • Divergence between the pruned files and doctrine_migration_versions/migrations rows, causing migrate to report "already applied" for versions with no file, or to re-run nothing where it should.
  • Broken rollback/migrate:refresh after the pruned migration's down-path is gone.
  • Silent partial prune (e.g., a naming-convention mismatch) leaving a non-deterministic set of files across branches.
  • Composer constraint conflicts during unrelated upgrades, forcing a fork at an inconvenient time.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package