Working on a Rails 5 app, I want to use structure.sql
instead of schema.rb
(we're using PostGIS with lots of custom SQL calls...). In config/initializers/database_options.rb
I have the following:
# use structure.sql, not schema.rb
Rails.application.config.active_record.schema_format = :sql
If I run the following:
$ rake db:migrate
it generates db/schema.rb
, not db/structure.sql
.
The rails guides say:
There are two ways to dump the schema. This is set in config/application.rb by the config.active_record.schema_format setting, which may be either :sql or :ruby.
What magic am I missing here?
config/application.rb
or one of the environment configs. – Rhotacism