small medium large xlarge

Generic-user-small
06 May 2008, 13:21
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 ;)

Samr_small_pragsmall
06 May 2008, 17:58
Sam Ruby (634 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