rake db:schema:dump vs. config.active_record.schema_format = :ruby

120 views
Skip to first unread message

Jan Lühr

unread,
Jan 23, 2015, 11:33:21 AM1/23/15
to rubyonra...@googlegroups.com
Hello folks,

I've some issues with 
rake db:structure:dump and rails 4.2.0

If config.active_record.schema_format = :ruby,  rake db:structure:dump will generate structure.sql nevertheless - tests will fail because of a missing schema.rb file
(/home/jan/RubymineProjects/cdb3/db/schema.rb doesn't exist yet. Run `rake db:migrate` to create it, then try again. If you do not intend to use a database, you should instead alter /home/jan/RubymineProjects/cdb3/config/application.rb to limit the frameworks that will be loaded.
Started)

What's wrong here? 

Thanks in advance, 
Jan

Frederick Cheung

unread,
Jan 23, 2015, 4:16:00 PM1/23/15
to rubyonra...@googlegroups.com
db:structure:dump always generates structure.sql - the schema_format settings controls whether it is invoked at all (or whether db:schema:dump is called). (See https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/railties/databases.rake#L48). Was schema_format previously set to :sql ?

Fred 
Reply all
Reply to author
Forward
0 new messages