I am working on a Rails project, and sometimes I program at home and sometimes at work. In my development process, I add data to the database, and I really need a way to synchro
write a rake task:
namespace :db do
task :backup do
system "mysqldump --opt --user=root --password rose userdetails> xyz.sql"
end
task :restore do
system "mysqldump --user=root --password < xyz.sql"
end
end
By the rake db:backup
you will get the sql that you can commit to your git/svn and once you work from home to restore pull it and run rake db:restore