The situation might come when the whole data-column in few tables of production database have to be altered. Most probably when you forgot to set default value in data-fields and stored Null value is troubling you when querying.
If you are willing to change the data in
- SSH into you production environment
- CHDir to your current deployment dir open
--sandboxmode See here for more detail about rails console http://edgeguides.rubyonrails.org/command_line.html#rails-console
- Apply the changes you desire and verify the changes if it is as you expected
- if it is as you expected, type all the commands in notepad with
;at the end of every statement or proper
- After that copy all the commands at once..
- open Rails console in normal mode and execute the commands at once
Rails console in Sandbox mode: Any changes you make is rolled back after you exit the console.
And, Changing data in
productionwithout verifying properly could cost you a fortune. so be careful.