# Handling changes in models in migrations

**URL:** <https://www.ruby-forum.com/t/handling-changes-in-models-in-migrations/112008>\
**Category:** Rails\
**Created:** [August 14, 2007, 8:21am UTC](https://www.ruby-forum.com/t/handling-changes-in-models-in-migrations/112008 "2007-08-14T08:21:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![helpy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/d2c977/32.png) [@helpy](https://www.ruby-forum.com/u/helpy)\
**Post date:** [August 14, 2007, 8:21am UTC](https://www.ruby-forum.com/t/handling-changes-in-models-in-migrations/112008/1 "2007-08-14T08:21:00Z")

</div>

Hello Rails list,

I had a question regarding dealing with changes to models and  
migrations. When a model has its name changed or is deleted in a  
newer migration this has the possibility of breaking an earlier  
migration that believes that model still exists but doesn’t.

How have been handling this? The Rails wiki suggests to not use  
application models in a migration or try to create temp models to  
handle this case. However, on a project our team has been working on  
the number of migrations that would have to be touched to fix this is  
quite unwieldy.

How have people here been trying to deal with this situation? Don’t  
get into it? 🙂 Some magic ruby-fu to convert all bad migrations  
into a good one? Ignore it and deal with the problem when it happens?

Cheers,  
Alain

---

<div class="post-metadata">

**Author:** ![helpy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/d2c977/32.png) [@helpy](https://www.ruby-forum.com/u/helpy)\
**Post date:** [August 14, 2007, 9:05am UTC](https://www.ruby-forum.com/t/handling-changes-in-models-in-migrations/112008/2 "2007-08-14T09:05:05Z")

</div>

On 8/14/07, Alain H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> handle this case. However, on a project our team has been working on  
> the number of migrations that would have to be touched to fix this is  
> quite unwieldy.

You should be doing this from the start then. Or, just remove the old  
migrations.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)
