Symfony 1.4 Doctrine 1.2 Migrations How to

Step 1. Create database

1
php symfony doctrine:build-db

Step 2. Create model classes

1
php symfony doctrine:build --all-classes

Step 3. Create migration classes based on model classes

1
php symfony doctrine:generate-migrations-models

Step 4. Now, migrate!

1
php symfony doctrine:migrate

One thought on “Symfony 1.4 Doctrine 1.2 Migrations How to”

  1. Additionally, when you make changes to the schema.yml you should execute the following tasks:

    php symfony doctrine:generate-migrations-diff –env=dev
    php symfony doctrine:build –all-classes –sql
    php symfony doctrine:migrate –env=dev –trace

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>