doctrine/doctrine-migrations-bundle
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
doctrine/doctrine-bundle | 2.12.0 | - | MIT | prod | |
doctrine/migrations | 3.7.4 | - | MIT | prod | |
doctrine/persistence | 3.3.2 | - | MIT | prod dev | |
symfony/deprecation-contracts | v3.5.0 | - | MIT | prod dev | |
symfony/framework-bundle | v7.0.7 | - | MIT | prod | |
symfony/var-exporter | v7.0.7 | - | MIT | prod dev |
The doctrine/doctrine-migrations-bundle is a crucial tool for Symfony applications that integrates the Doctrine Migrations library. This exceptional bundle offers a streamlined channel for handling and managing database migrations. It enables users to version their database schema changes and apply these changes predictably and consistently across all servers running the respective application.
To use the doctrine/doctrine-migrations-bundle, you'll first need to install the bundle. You can readily do this with Composer, using the command: composer require doctrine/doctrine-migrations-bundle
. After installing, enable it by adding it to your application's kernel: new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle()
in the bundles.php
file.
To create a migration, you can use console command:
php bin/console doctrine:migrations:diff
This will generate a new migration class with the changes detected in your entities.
To execute the migration(s), run the following command:
php bin/console doctrine:migrations:migrate
This command will apply the migration which was prepared previously.
Remember, before executing these commands, a configuration file (doctrine_migrations.yaml
) should be set up, specifying your database details.
Detailed documentation for the doctrine/doctrine-migrations-bundle can be accessed at Symfony's official website. This documentation provides a comprehensive guide on how to get started, configure, and effectively use the DoctrineMigrationsBundle. The instructions are clear and concise, ensuring a quick grasp even for beginners in Symfony development. The documentation is thoughtfully composed with practical examples, making it the go-to resource for understanding and utilizing the doctrine/doctrine-migrations-bundle.