I have been developing different java web based applications. As a junior-mid level developer I spent my time mostly dealing with development data only in which it is not that much of a big deal erasing data, adding test data and so on. But now, I am doing a side project using Ruby on Rails by my own and responsible for every development stages and data (i.e on dev, prod, and test). Even at this stage I was sometimes erasing prod data (which is on Heroku) and re populating it using "db:populate" that is provided by Rails framework. However, the system is going live after a month (to hear feedback from users) and I know I won't have the option of erasing data if something went wrong from now on.
Based on your experience, what precautions should I take when something is wrong with real production data?
heroku run console
.Sometimes, you can use a class which is also an ActiveRecord Migration. But this will not always work out, and sometimes you must simply use a normal class you write from scratch yourself.