Schema in SQL?

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

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

Check your config/environment.rb

config.active_record.schema_format = :sql

Uncomment that line, you’ll get an SQL file instead.

Jason

rake db:structure:dump
did just the trick! thanks a lot.
-john

James D. 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

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