9951 explained code solutions for 126 technologies


php-symfonyHow to run migrations in PHP Symfony?


Migrations in Symfony are managed by the Doctrine Migrations Bundle. To run migrations, you need to install the bundle first.

composer require doctrine/doctrine-migrations-bundle

After the bundle is installed, you can run the migrations with the following command:

php bin/console doctrine:migrations:migrate

This command will execute all the migrations that have not been executed yet.

  1. composer require doctrine/doctrine-migrations-bundle - installs the Doctrine Migrations Bundle
  2. php bin/console doctrine:migrations:migrate - runs the migrations

Helpful links

Edit this code on GitHub