I am current developing a big migration script, where I need to do the following:
1- Create new columns in table_1
2- Copy the values form table_2 to the new columns created in table_1
3- Delete table_2
I developed the up and down methods for this migration. My problem is that step 2 is just not copying my data correctly I need to be able to test/debug my code as it runs.
If there is a way please let me know. I am currently using Rails 2.3.8 but If there is a way for Rails 3 or 3.1 also please let me know.
Thanks a lot
To debug your data migration, you can use the
ruby-debuggem and insert a breakpoint in the migration code:Then run the rake task:
Quick ruby-debug tutorial here.