0

I have the line config.active_record.schema_format = :sql in my application.rb file but I'm still having the problem that when I type rails db:migrate it doesn't output the :sql version. In fact it doesn't output anything. When I type in rails db:structure:dump it doesn't output anything either. However, when I type in rails db:schema:dump it outputs the schema.rb file. I'm using postgresql and rails 5.0.

It seems to me that for some reason rails db:structure:dump is not working but I don't know how to debug this. Any help will be greatly appreciated.

~/main$ rails db:schema:dump --trace
** Invoke db:schema:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:schema:dump

Similar but different question: In Rails 5, setting config.active_record.schema_format = :sql but still getting schema.rb created on db:migrate

stevo999999
  • 588
  • 4
  • 12
  • 1
    It's possible that got over-ruled somewhere else. Are there any references to `schema_format` in your code elsewhere? – tadman Jan 27 '20 at 21:49
  • @tadman there is no where else in the code where you have schema_format. Do you have any tips for how to debug this? – stevo999999 Jan 28 '20 at 22:44
  • First thing I usually try is to check on another project to see if I can reproduce it. The next thing I do is upgrade Rails to the latest version that doesn't break anything. 5.0 is pretty old now, so there could be bugs. – tadman Jan 28 '20 at 22:49

0 Answers0