stase
stase

Reputation: 121

Doctrine 2 Migrations Workflow

I am developing a web application using Zend Framework 2 and Doctrine 2. I'm new to Doctrine 2 in general and Migrations in particular. I was wondering if there are any recommended best practices in using this. Some specific things I'm looking for:

Many thanks!

Upvotes: 12

Views: 1436

Answers (2)

Adam Lundrigan
Adam Lundrigan

Reputation: 598

The Doctrine ORM module for ZF2 (DoctrineORMModule) has built-in support for Doctrine ORM migrations. There's a very brief blurb in the documentation about how to configure it. You can then access the migration commands (generate, migrate, etc) through the CLI interface that module provides (vendor/bin/doctrine-module)

As for my personal workflow I generally put initialization or pre-population data - the stuff you initially seed a new installation with - into database fixtures (which Doctrine ORM also supports and there is a ZF2 module for).

Upvotes: 1

Tomas Votruba
Tomas Votruba

Reputation: 24280

Doctrine has own library for migrations, that includes also Symfony bundle.

For Zend there probably is some bundle as well (maybe seek on Github a bit more)

As for your specific questions:

  1. Nothing special. Basic workflow is nicely described in Symfony bundle documentation. We use it in pretty same way even in a different framework.

  2. Yes, so every developer has fully operational system. For tests we use data-fixtures with minimal required data only.

  3. It's managed by this package itself.

Upvotes: 4

Related Questions