On 4/27/09 4:31 AM, Lee Hambley wrote:
> Jacobo,
>
> You may need to implement something like the following pesudocode:
>
>     * http://pastie.org/459506

Be very careful, though, because migrations are not (in general) 
reversible. Specific migrations may be, but the only way to be 100% sure 
of a migration being reversible is to do a complete backup of your 
database immediately before the migration. Then, to reverse the 
migration, "simply" restore the backup. Unfortunately, for databases of 
any relevant size, creating or restoring a snapshot is non-trivial, 
which is why Capistrano doesn't do it by default.

- Jamis

>
> I don't know how well that might work out, or if there is anything
> internally that would help, I note the following rake tasks in my Rails
> 2.2.2 application:
>
>     rake db:migrate
>     rake db:migrate:down
>     rake db:migrate:redo
>     rake db:migrate:reset
>     rake db:migrate:up
>     rake db:reset
>     rake db:rollback
>
>
> - Lee
>
> 2009/4/27 Jacobo García <[email protected]
> <mailto:[email protected]>>
>
>     I am looking for a way to roll back a migration.
>
>     So if I run 'cap deploy:migrations' and something in the app is
>     troublesome, running 'cap rollback' (with this rollback_migrations
>     as a hook) will leave the database in the same point that before
>     running 'cap deploy:migrations'
>
>     Is there any common formula to solve this problem?
>
>     Thanks in advance.
>
>
>     Jacobo García López de Araujo
>     blog: http://www.robotplaysguitar.com
>
>
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to