Declarative database schemes - automatically create migration files?

I’m looking for something like this:

class Foo
include Model
field id, serial
field name, Text
end

migrate

now migrate should write these two files:

migrations/scheme1.rb # current representation of the scheme
migrations/migration1.rb # migrate up to get database into scheme1
state.

Then when adding a value

class Foo
[…]
field city, Text # << new
end

then migrate should diff migration/scheme1.rb with what the code
contains and write

migrations/scheme2.rb
migrations/migration2.rb

and let me review/edit migration2 before it gets run.

Does such a library already exist in some way?

Marc W.

That looks like DataMapper to me :wink:
http://datamapper.org/getting-started.html

k

Excerpts from Kaspar S.'s message of Mon Nov 26 08:20:04 +0100
2012:

That looks like DataMapper to me :wink:
http://datamapper.org/getting-started.html
Its closest - I’ve been hanging around on that channel for days.

They’re working on a new version right now.
But that its what comes closest - so its the right project to spend my
time on.

Marc W.