# Migrations: best practices

**URL:** <https://www.ruby-forum.com/t/migrations-best-practices/119167>\
**Category:** Rails\
**Created:** [November 4, 2007, 6:52am UTC](https://www.ruby-forum.com/t/migrations-best-practices/119167 "2007-11-04T06:52:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.sean.kelly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@m.sean.kelly](https://www.ruby-forum.com/u/m.sean.kelly)\
**Post date:** [November 4, 2007, 6:52am UTC](https://www.ruby-forum.com/t/migrations-best-practices/119167/1 "2007-11-04T06:52:16Z")

</div>

In AWDWR v2 there are two high-level paths for migrations suggested:

1. Have a new migration file for each schema change that arises during  
the course of development. Theoretically, this enables one to update  
the schema in any of the environments, even production.
2. Have a migration file for each table. This is offered as a way to  
maintain a view of the schema in a single location, but seems to  
abandon all hope of running the migrations against production.

I’d like to throw out a third option: have a single migration file for  
each release. This way the changes that are collectively required for  
the release are in a single location, and the migration can be run to  
update production. If you need a readable document showing the current  
state of the schema, then update the schema.rb file.

I’m new to RoR, and to this list, so it’s very likely that this option  
has already seen a good deal of discussion (although I didn’t see  
anything in a quick scan of the archive). If this has already been  
beaten to death, then point me in the direction of the carcass.

Thanks,

-=michael=-

Michael Kelly  
Team Lead, Applications Group

> **[Home](https://www.learning.com/)**
>
> \[et\_pb\_section fb\_built=”1″ custom\_padding\_last\_edited=”on|phone” disabled\_on=”off|on|on” \_builder\_version=”4.16″ \_module\_preset=”default” background\_image=”https://www.learning.com/wp-content/uploads/2021/02/HeroBanner\_C2\_Working.jpg”...

---

<div class="post-metadata">

**Author:** ![m.sean.kelly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@m.sean.kelly](https://www.ruby-forum.com/u/m.sean.kelly)\
**Post date:** [November 4, 2007, 4:16pm UTC](https://www.ruby-forum.com/t/migrations-best-practices/119167/2 "2007-11-04T16:16:29Z")

</div>

Hi Michael

I am not sure whether this would be useful to you but I wrote an  
article on moving a legacy database to Rails in my blog.

CCH

> **[Rails... Rails... Rails](http://cch4rails.blogspot.com)**
>
> Chee Chong Hwa aka CCH, a Malaysian Chief Software Architect blogs on his experiences with Ruby on Rail running on Win2003 Server+Apache 2.26 environment since 2007. Flirted briefly with Ubuntu 9.04 in 2009. Since January 2017, now using RubyMine...
