Creating Migration Files From MySQL

0 views
Skip to first unread message

Scott Harvey

unread,
Oct 15, 2006, 9:31:09 PM10/15/06
to rubyonra...@googlegroups.com
Hey,

I have an application running and I have been creating and editing the
table through my mysql interface up till now.

I want to create my migration files based on my MySQL tables but I have
so many tables it would take a long time to do it manually.

Is there anyway to generate migration files based on existing MySQL
tables?

Thanks for the help.

--
Posted via http://www.ruby-forum.com/.

_Kevin

unread,
Oct 15, 2006, 9:39:35 PM10/15/06
to Ruby on Rails: Talk

On Oct 15, 9:31 pm, Scott Harvey <rails-mailing-l...@andreas-s.net>
wrote:

There is an 'extract fixtures' rake task described in the rails recipes
book that can write your current data to a series of YAML files. That
may help some.

_Kevin

Cayce Balara

unread,
Oct 15, 2006, 9:41:54 PM10/15/06
to rubyonra...@googlegroups.com
rake db:schema:dump

Will create <application>/db/shema.rb with your entire database
migration schema.

You should look into how migrations work - if you make your changes
through migrations, you'll have a versionable history of those changes,
versus having nothing when you just make the changes in your tool. There
was a post in the last couple weeks discussing migrations in detail.

c.

Reply all
Reply to author
Forward
0 new messages