/ Published in: Rails

Add "rescue nil" to migration commands that you want the migration to try but don't care if it fails. Helpful for debugging migrations and helpful when you want to modify a previous migration, let's say add a column, and you don't want the remove column in the drop block to choke your reverse migration.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
add_column :users, :ssn_part, :string rescue nil
Comments
