Are you talking about what Rails does, or about how some framework in
general might do this? The comment from Joe Van Dyk suggests that now,
in Rails, you can evolve your object model and the database will
automagically change with it; no more need to "code" in SQL.
Exactly. Migrations were originally intended to solve the problem of
evolving a database schema across multiple databases with as little
pain as possible and without loosing your data. Especially the last
bit is where most Object->SQL auto-generation schemes fall down.
But it can certainly also be used to create your entire database from
scratch, so that you won't have to touch SQL at all. Example:
create_table :system_settings do |t|
t.column :name, :string
t.column :label, :string
t.column :value, :text
t.column :type, :string
t.column
osition, :integer
end
It currently only works for MySQL and PostgreSQL, but we're working on
SQLite support using temporary tables, which in turn will make it
suitable for SQL Server, Sybase, and all the other databases that
aren't jiggy with ALTER TABLE.
There's more information at:
http://api.rubyonrails.org/classes/ActiveRecord/Migration.html
And there's full Rails support in form of "script/generate migration
add_system_settings" and "rake migrate".
We've been using it for quite a while with all the 37signals
applications and its such bliss to be able to treat your schema as
clay instead of rock.
--=20
David Heinemeier Hansson
http://www.loudthinking.com -- Broadcasting Brain
http://www.basecamphq.com -- Online project management
http://www.backpackit.com -- Personal information manager
http://www.rubyonrails.com -- Web-application framework