Is there a straightforward way (rake task?) to convert the generated ruby schema file into SQL? I want to do some visualization with MySQL Workbench, but the free version can''t reverse engineer a live db - it needs a schema file in SQL. Any alternative suggestions or approaches are also welcome. Thanks a ton in advance. -john -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
You can change environment.rb to use: config.active_record.schema_format = :sql or I think that rake db:structure:dump will do it JD On Jan 16, 2008, at 10:30 AM, John Hack wrote:> > Is there a straightforward way (rake task?) to convert the generated > ruby schema file into SQL? I want to do some visualization with MySQL > Workbench, but the free version can''t reverse engineer a live db - it > needs a schema file in SQL. Any alternative suggestions or approaches > are also welcome. > > Thanks a ton in advance. > -john > -- > 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?hl=en -~----------~----~----~----~------~----~------~--~---
Check your config/environment.rb # config.active_record.schema_format = :sql Uncomment that line, you''ll get an SQL file instead. Jason On Jan 16, 2008 1:30 PM, John Hack <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Is there a straightforward way (rake task?) to convert the generated > ruby schema file into SQL? I want to do some visualization with MySQL > Workbench, but the free version can''t reverse engineer a live db - it > needs a schema file in SQL. Any alternative suggestions or approaches > are also welcome. > > Thanks a ton in advance. > -john > -- > 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?hl=en -~----------~----~----~----~------~----~------~--~---
rake db:structure:dump did just the trick! thanks a lot. -john James Deville wrote:> You can change environment.rb to use: > > config.active_record.schema_format = :sql > > or I think that rake db:structure:dump will do it > > JD-- 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?hl=en -~----------~----~----~----~------~----~------~--~---
> Is there a straightforward way (rake task?) to convert the generated > ruby schema file into SQL? I want to do some visualization with MySQL > Workbench, but the free version can''t reverse engineer a live db - it > needs a schema file in SQL. Any alternative suggestions or approaches > are also welcome.rake db:structure:dump # Dump the database structure to a SQL file or mysqldump --no-data your_db > schema.sql --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---