SQL Script to Migrations


I’m working on a project where the database design was done by a non-
rails developer. I have .sql file with create table scripts. Is
there anything out there to convert a .sql file to Rails Migrations?

Thanks in advance. Scott.

On 08/09/06, [email protected] [email protected] wrote:

go to the db directory and say:

rake schema_dump

Actually, you can run this (and any other rake tasks) from anywhere
in the project tree. Rake shares a cool feature with Ant[1] - if it
can’t find a
Rakefile in the current directory, it will look in the parent directory,
that directorys parent, and so on until it finds one (that’s why it
‘in /foo/blah/projectdir’ to tell you where it found the Rakefile).


[1] despite it’s java roots, ant was one of the better build tools I’ve
Saved me weeks of work, and made java development almost pleasant.

Rasputin :: Jack of All Trades - Master of Nuns

go to the db directory and say:

rake schema_dump

(which creates a new schema.rb from the database specified in