Forum: Ruby declarative database schemes - automatically create migration files?

Posted by Marc Weber (Guest)
on 2012-11-23 09:11
(Received via mailing list)
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 Weber
Posted by Kaspar Schiess (kaspar)
on 2012-11-26 08:20
(Received via mailing list)
That looks like DataMapper to me ;)
http://datamapper.org/getting-started.html

k
Posted by Marc Weber (Guest)
on 2012-11-26 08:41
(Received via mailing list)
Excerpts from Kaspar Schiess's message of Mon Nov 26 08:20:04 +0100 
2012:
> That looks like DataMapper to me ;)
> 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 Weber
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.