Topic: DANGER: rake db:migrate drops the entire database. How to avoid this?
I had a legacy rails app which is working fine against a database.
I am building a new rails app which is aimed at replacing eventually the old legacy app. It runs against the same database.
When I first created the new rails app, I created a first migration to add a new table.
I ran rake db:migrate, and it deleted the entire database with its tens of thousands of records! Thanks god it was in dev environment. And thank god, I managed to restore this entire database (I copied all the migrations from the legacy app to the new app) and reran the entire migrations from scratch.
Now I would like to put my new app in a production environment. How can I run a new migration in production without deleting the entire production database, but just incrementally run the last migration on top of the existing database?
Is there an option, a parameter to pass to the rake db:migrate command to prevent it from deleting the existing database?