> * ActiveRecord''s ER descriptions can be used (perhaps
> with some added information) to create a database.
> Having to muck about directly with MySQL seems like
> a poor fit with the rest of Rails...
Well, I had a really long, well thought out reply to this, but Gmail''s
spellchecker ate it. Sigh.
So in short, no, you can''t. This is actually the opposite of
AR''s
philosophy on database relationships. Look in contrast to Java''s
Hibernate: Hibernate is a very powerful ORM tool that requires
extensive XML configuration. Hibernate can (with the addition of
XDoclet and MiddleGen) do exactly what you have suggested above, but
once again is quite heavyweight and I actually found it a bit of a
bugger to get working right.
So ActiveRecord goes to the other side - to get up and going there''s
no XML configuration; you just set the database connection parameters
and AR infers the rest. Got a different table name than expected?
Fine, put it in, but otherwise there''s no need to tell it what the
data types are or what the name is. And if ActiveRecord doesn''t know
about the database you''re using, then all that needs to be done is to
write a driver for it, like the Oracle users did not long ago. Table
associations are one-liners. The lack of code makes it easier for me
to see what I''m doing and spend more time on solving problems rather
than mucking about in XML. Which I much prefer.
If you''re allergic to SQL, you might want to check out a GUI tool such
as MySQL-Front.. I''ve never used it but it was mentioned in the
Rolling With Ruby on Rails onlamp article so it might be worth
checking out.
Hope that helps,
Dan