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/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On Oct 15, 9:31 pm, Scott Harvey <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 viahttp://www.ruby-forum.com/.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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
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. Scott Harvey wrote:> 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/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---