webignition/doctrine-migrations-bundle
Symfony bundle integrating Doctrine Migrations with configuration and console commands for generating and running database migrations in Symfony applications. A lightweight fork of the official DoctrineMigrationsBundle.
This package is a Symfony bundle, not a Laravel package. Before doing anything else, confirm you actually need it:
webignition/doctrine-migrations-bundle is a fork of doctrine/doctrine-migrations-bundle. Diff it against upstream (composer show -a doctrine/doctrine-migrations-bundle) to see what the fork changes — usually a PHP/Symfony version constraint bump or a patch for an abandoned branch. In a Laravel app, you almost never want this; you want doctrine/migrations directly.AppKernel.php:
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
and add a doctrine_migrations: block to config.yml (at minimum dir_name: "%kernel.root_dir%/DoctrineMigrations" and namespace: Application\Migrations).php bin/console doctrine:migrations:status --show-versions — verifies the bundle is wired up and shows which migrations have run.In a Laravel project, the equivalent first step is to install doctrine/migrations standalone (composer require doctrine/migrations), add vendor/bin/doctrine-migrations as your entry point, and drop a migrations.php / migrations-db.php config at project root. That's the "first use case" for a Laravel developer: generate a migration from an existing schema with doctrine-migrations diff.
Symfony (the intended target):
app/DoctrineMigrations (Symfony 2/3) or src/Migrations with migrations_paths (Symfony 4+ config style, if this fork supports it).diff → inspect → migrate → status → version for rollbacks.--allow-empty-diff in CI to fail fast when schema drifts unintentionally.migrations_base_class at your own abstract AbstractMigration subclass to inject helpers (e.g., a now() timestamp column helper).doctrine:migrations:migrate --no-interaction in your deploy hook (Capistrano/Envoy/make target), before workers restart.Laravel-idiomatic alternative (recommended):
doctrine/migrations + doctrine/dbal gives you the same diff, migrate, status, version, generate verbs without a bundle.migrations table only if you truly must — see Gotchas.migrate --to=<version> to a fixture version, then migrate first in teardown.Integration tips:
doctrine_migration_versions (Symfony default) or a distinct table name to avoid collision with Laravel's migrations table if both coexist.storage / table_storage to a per-tenant table.doctrine/doctrine-migrations-bundle if your Symfony version is still supported and the fix in this fork has been merged upstream.composer require resolution fails, inspect the composer.json constraints in the tag rather than guessing.Bundle::class / build() — it's invisible to Laravel's service container. Don't try to composer require it into a Laravel app expecting artisan commands; you'll just install dead weight.doctrine:migrations:* don't appear in bin/console list, the bundle isn't registered, or the commands are conditionally registered when a doctrine connection exists. Check debug:container --tag=console.command.migrate and Doctrine migrations, keep table names distinct (doctrine_migration_versions vs migrations) and never let both track the same table.doctrine:migrations:diff -vvv — the bundle frequently suppresses mapping errors; the verbose flag surfaces them.doctrine.migrations service alias, or set migrations_base_class / migrations_directory; these are the two supported points this fork likely preserves from upstream.git diff upload upstream/vX..fork/vX in the repo — the delta is typically a one-line constraint change, meaning you can often use replace or a Composer conflict/inline-alias trick against upstream instead of adding a fork dependency.How can I help you explore Laravel packages today?