Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
Using Doctrine Migrations as a standalone tool
Nov 13, 2014 @ 16:14:56

Rob Allen has a recent post to his site showing you how you can use Doctrine migrations as a standalone tool for its migrations functionality. Migrations allow you to script the setup of your database, replacing the need to manually create and configure the system by hand.

My current project has reached the point where a good migrations system is required. As I'm targeting two different database engines (MySQL and MS SQL Server) and we're already using DBAL, it made sense to use Migrations from the Doctrine project.

He walks you through the installation (via Composer and a command-line script to bootstrap the Doctrine environment outside of the usual framework context. He includes an example yaml configuration file and PHP-based connection information config. He finishes off the post by showing how to build a simple migration that creates an "artists" table (with "name" and "id" columns) and run the command to do the work.

tagged: migration standalone tool doctrine tutorial commandline

Link: http://akrabat.com/php/using-doctrine-migrations-outside-of-doctrine-orm-or-symfony/


Trending Topics: