jcrisp / rails_refactor

Simple refactoring like rename class for Rails projects
http://jamescrisp.org/2010/11/27/rails-refactor-hack-night/
123 stars 20 forks source link

Should not change migrations #34

Open softwaregravy opened 2 years ago

softwaregravy commented 2 years ago

Migrations which have been committed and deployed should be effectively immutable. Rather than editing past migrations, it would be better to create a new migration which renames the table. As is, renaming a model cannot be used in a production system.

jcrisp commented 2 years ago

Thanks for the suggestion, it sounds like a highly useful improvement. Would you be interested in writing a (small) PR for it? I'd suggest making it an option based on a command line switch, as there are times when you'd want to rename directly and others where you'd want a migration.