Declarative database schemes - automatically create migration files?

I’m looking for something like this:

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


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

Then when adding a value

class Foo
field city, Text # << new

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


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:


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

That looks like DataMapper to me :wink:
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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs