php bin/console doctrine:migrations:migrate
Execute a migration to a specified version or the latest available version.
Usage
doctrine:migrations:migrate [--write-sql] [--dry-run] [--query-time] [--allow-no-migration] [--configuration [CONFIGURATION]] [--db-configuration [DB-CONFIGURATION]] [--db DB] [--em EM] [--shard SHARD] [--] [<version>]
Arguments
version The version number (YYYYMMDDHHMMSS) or alias (first, prev, next, latest) to migrate to.
Options
--write-sql The path to output the migration SQL file instead of executing it.
--dry-run Execute the migration as a dry run.
--query-time Time all the queries individually.
--allow-no-migration Don't throw an exception if no migration is available (CI).
--configuration The path to a migrations configuration file.
--db-configuration The path to a database connection configuration file.
--db The database connection to use for this command.
--em The entity manager to use for this command.
--shard The shard connection to use for this command.
Help
The doctrine:migrations:migrate command executes a migration to a specified version or the latest available version:
bin/console doctrine:migrations:migrate
You can optionally manually specify the version you wish to migrate to:
bin/console doctrine:migrations:migrate YYYYMMDDHHMMSS
You can specify the version you wish to migrate to using an alias:
bin/console doctrine:migrations:migrate prev
You can also execute the migration as a --dry-run :
bin/console doctrine:migrations:migrate YYYYMMDDHHMMSS --dry-run
You can output the would be executed SQL statements to a file with --write-sql :
bin/console doctrine:migrations:migrate YYYYMMDDHHMMSS --write-sql
Or you can also execute the migration without a warning message which you need to interact with:
bin/console doctrine:migrations:migrate --no-interaction
You can also time all the different queries if you wanna know which one is taking so long:
bin/console doctrine:migrations:migrate --query-time