php bin/console doctrine:migrations:migrate

Execute a migration to a specified version or the latest available version.

Usage

doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--] [<version>]

Arguments

version   The version FQCN or alias (first, prev, next, latest) to migrate to. 

Options

      --write-sql            The path to output the migration SQL file. Defaults to current working directory. 
      --dry-run              Execute the migration as a dry run. 
      --query-time           Time all the queries individually. 
      --allow-no-migration   Do not throw an exception if no migration is available. 
      --all-or-nothing       Wrap the entire migration in a transaction. 
      --configuration        The path to a migrations configuration file. <comment>[default: any of migrations.{php,xml,json,yml,yaml}]</comment> 
      --em                   The name of the entity manager to use. 
      --conn                 The name of the connection to use. 

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 show more information about the process by increasing the verbosity level. To see the
executed queries, set the level to debug with -vv:

    bin/console doctrine:migrations:migrate -vv

You can optionally manually specify the version you wish to migrate to:

    bin/console doctrine:migrations:migrate FQCN

You can specify the version you wish to migrate to using an alias:

    bin/console doctrine:migrations:migrate prev
    These alias are defined : first, latest, prev, current and next

You can specify the version you wish to migrate to using an number against the current version:

    bin/console doctrine:migrations:migrate current+3

You can also execute the migration as a --dry-run:

    bin/console doctrine:migrations:migrate FQCN --dry-run

You can output the prepared SQL statements to a file with --write-sql:

    bin/console doctrine:migrations:migrate FQCN --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

Use the --all-or-nothing option to wrap the entire migration in a transaction.