Ruby / Rails - Reverse Migration - DDL for Ruby Code

Any tools in Ruby or Rails that will allow me to fetch the entire table schema from the database and generate Ruby equivalent "DLL" expressions?

Something that would allow me to port my schema from Microsoft SQL Server to Postgres or MySQL to Sqlite.

+2


source to share


1 answer


In Rails / ActiveRecord you can use rake db:schema:dump

to generate db / schema.rb and rake db:schema:load

to load into database.



+4


source







All Articles