06 May 2008, 13:21
Generic-user-small

tommy kelly (3 posts)

Stupid silly question, but what happens if you exceed 999 migrations / changes to your database?

I ask because each migration’s name starts with 00x, so what after 999 ;)

06 May 2008, 17:58
Samr_small_pragsmall

Sam Ruby (567 posts)

In Rails 2.0.2 and prior, migration names started with a number with a minimum length of 3, left padded with zeros as necessary. So after 009 comes 010; after 099 comes 100; and after 999 comes 1000. In other words, it does the equivalent of:

sprintf("%03d", n)

In Rails 2.1, migration names start with a timestamp, so this problem is avoided entirely.

  You must be logged in to comment