# Get Rid of Date in Migration Filename

**URL:** <https://www.ruby-forum.com/t/get-rid-of-date-in-migration-filename/148179>\
**Category:** Rails\
**Created:** [September 10, 2008, 3:46am UTC](https://www.ruby-forum.com/t/get-rid-of-date-in-migration-filename/148179 "2008-09-10T03:46:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trogdor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5ac83/32.png) [@Trogdor](https://www.ruby-forum.com/u/Trogdor)\
**Post date:** [September 10, 2008, 3:46am UTC](https://www.ruby-forum.com/t/get-rid-of-date-in-migration-filename/148179/1 "2008-09-10T03:46:31Z")

</div>

I was wondering how to get Rails 2.1 migrates to go from generating  
20080910014108\_create\_table.rb-esque migrations to the old  
22\_create\_table.rb style ones. I am sure that there is some sort of  
advantage in having timestamps in the file name, I just haven’t  
figured it out yet.

Thanks in advance,

Joe

---

<div class="post-metadata">

**Author:** ![Trogdor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5ac83/32.png) [@Trogdor](https://www.ruby-forum.com/u/Trogdor)\
**Post date:** [September 10, 2008, 5:03am UTC](https://www.ruby-forum.com/t/get-rid-of-date-in-migration-filename/148179/2 "2008-09-10T05:03:08Z")

</div>

the advantage to the datetime based filenames over the simple integers  
is that it allows you to work in branches, make migrations and merge  
it all back together later without fear of conflicting migrations. why  
would you want to go back?

---

<div class="post-metadata">

**Author:** ![Trogdor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5ac83/32.png) [@Trogdor](https://www.ruby-forum.com/u/Trogdor)\
**Post date:** [September 10, 2008, 5:18am UTC](https://www.ruby-forum.com/t/get-rid-of-date-in-migration-filename/148179/3 "2008-09-10T05:18:55Z")

</div>

Ahh, that does make sense.

I am the only dev working on this project, so I do a lot of rake  
db:migrate VERSION=22 stuff to roll back migrations, trying to do  
VERSION=20080214017515 is just a hassle.

Being a loner I forget sometimes that people write software with other  
people…

---

<div class="post-metadata">

**Author:** ![Trogdor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5ac83/32.png) [@Trogdor](https://www.ruby-forum.com/u/Trogdor)\
**Post date:** [September 10, 2008, 5:26am UTC](https://www.ruby-forum.com/t/get-rid-of-date-in-migration-filename/148179/4 "2008-09-10T05:26:31Z")

</div>

If you’re wanting to rollback, just use rake db:rollback?

---

<div class="post-metadata">

**Author:** ![Trogdor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5ac83/32.png) [@Trogdor](https://www.ruby-forum.com/u/Trogdor)\
**Post date:** [September 10, 2008, 7:42am UTC](https://www.ruby-forum.com/t/get-rid-of-date-in-migration-filename/148179/5 "2008-09-10T07:42:16Z")

</div>

If you still need it you can set  
config.active\_record.timestamped\_migrations = false to have migrations  
with numeric prefix instead of UTC timestamp.

But for this you need to upgrade to Rails 2.1.1. See #21 under ‘Active  
Record’ heading in this change log:

> <https://gist.github.com/8946>

-subbu
