I am using Doctrine2 migrations. I need some answers about my doubt, I canno find a good solution in documentations
I use:
doctrine migrations:diff // generate migrations files doctrine migrations:migrate // migrates up to new version
How Can I migrate down? specifying the previous version did not work ( nothing to update it says f.e. doctrine migrations:migrate Version20120211163332 it says
Migrating up to Version20120211163332 from 20120309112058 [Doctrine\DBAL\Migrations\MigrationException] Could not find any migrations to execute.
But it's not up it should be down! you can see also on versions in response
If I have to make some DB update, is it possible to add some SQL Queries in additions ( alter some datas related to other) ? I have not tried still since the down is not working :((
Is there any way to use the migrate command in a browser nutshell ? I have sw in a shared hosting without console access so I need this feature, instead of copying queries one by one :D in phpMyAdmin
The Doctrine Migrations project offers additional functionality on top of the DBAL and ORM for versioning your database schema. It makes it easy and safe to deploy changes to it in a way that can be reviewed and tested before being deployed to production.
Database migrations are a way to safely update your database schema both locally and on production. Instead of running the doctrine:schema:update command or applying the database changes manually with SQL statements, migrations allow to replicate the changes in your database schema in a safe manner.
You can optionally manually specify the version you wish to migrate to:
php doctrine.php migrations:migrate YYYYMMDDHHMMSS
or execute a migration up/down
php doctrine.php migrations:execute YYYYMMDDHHMMSS --down php doctrine.php migrations:execute YYYYMMDDHHMMSS --up
You can found YYYYMMDDHHMMSS using:
php doctrine.php migrations:status >> Current Version: 2012-12-20 23:38:47 (20121220233847) >> Latest Version: 2012-12-20 23:38:47 (20121220233847)
I saw this doc on Symfony's website : http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html#usage
There is doctrine:migrations:execute
that allows you to execute a single migration version up or down manually... but never tried, sorry.
Hope this helps !
Keep us posted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With