[Rails] Intial data in Migrations

Sean Wolfe
Sat, 11 Feb 2006 00:02:46 -0000

One thing I found annoying about Migrations, besides that you have a
very limited ways to define your data, is that it will overwrite
EVERYTHING in your schema file. So if you spend hours customizing your
initial schema file, to get it work, exactly like you''ll need it, that
work immediately becomes for nothing once you run a migration. Your
entire schema will get rewritten, not appended to.

In that case, with migrations, how is one suppose to handle initial
data, such a look up table (such as state or country). Do those get
put into a separate file? something like an initialize_db.rb?

How have others been able to handle this with migrations?

--
Sean Wolfe
master nerd of
i heart squares, Co.

3711 N. Ravenswood Ave. #147 Chicago, IL 60613
Ph. (773) 531-6301  Fx. (773) 529-7041