Free Hosting

Free Web Hosting with PHP, MySQL, Apache, FTP and more.
Get your Free SubDOMAIN or or...
Create your account NOW at

Cheap Domains

Cheap Domains
starting at $2.99/year




Rails generate schema.rb from existing database

Sometimes we need to work with existing database and turn it into rails db schema script, this can cost you insane amount of time, here is a fast way to do it.

1. modify the database.yml to point to the database you want to generate from
2. rake db:schema:dump, now schema.rb should have scripts to create all the tables
3. modify the database.yml to point back to the correct database
4. rake db:schema:load, now the destination database should have all the tables

Comments (0) Trackbacks (0)

No comments yet.

Leave a comment


No trackbacks yet.