Free Hosting

Free Web Hosting with PHP, MySQL, Apache, FTP and more.
Get your Free SubDOMAIN you.6te.net or you.eu5.org or...
Create your account NOW at http://www.freewebhostingarea.com.

Cheap Domains

Cheap Domains
starting at $2.99/year

check

Dev

20Feb/120

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

(required)

No trackbacks yet.