rails_refactor icon indicating copy to clipboard operation
rails_refactor copied to clipboard

Should not change migrations

Open softwaregravy opened this issue 3 years ago • 1 comments
trafficstars

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.

softwaregravy avatar Jun 21 '22 14:06 softwaregravy

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.

jcrisp avatar Jun 21 '22 22:06 jcrisp