[Rails] Re: Generating SQL from model and not vice versa
David Heinemeier Hansson
david at loudthinking.com
Tue Mar 1 10:24:24 GMT 2005
>> Is it only to avoid switching to a tool specially designed for such
>> tasks and doing it with a few clicks/
>
> Few clicks? Hardly. Either way I have to type the table/class name,
> field/attribute names, data types, and associations. No savings on
> typing either way, but one less conceptual shift if everything is
> driven by code.
Have you seen the Rails videos? There was a new one just released that
shows the flow once again. When you make the changes straight on the
database, you don't have a build phase (generate SQL from model, drop
database, create new database), which means its change'n'reload to see
result.
And, as I described in the earlier example, you don't throw out the
data you've been working on to make a change. Which is the most
important benefit to me.
But the discussion is no longer an either or. Since I'm going to do the
migration approach anyway, having the possibility of an in-model schema
is a fairly trivial addition. And one that'll benefit those who don't
like to leave their editor while working a system or those who needs
the benefits of 1 abstract schema => 6 concrete schemas.
--
David Heinemeier Hansson,
http://www.basecamphq.com/ -- Web-based Project Management
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.loudthinking.com/ -- Broadcasting Brain
More information about the Rails
mailing list