I am running Rails 6.1.6
on ruby -v 2.7.1
.
I set this in my application.rb
file
config.active_record.schema_format = :sql
I tried to run my migrations but schema.rb
gets generated even as the existing structure.sql
file gets updated accordingly.
Extra info: I observed this behaviour when I upgraded to Rails 6.1
from 5.2
.
I don't suppose schema.rb
should ever be generated when schema_format
is set to :sql
. When I tried to set config.active_record.dump_schema_after_migration
to false
. My structure.sql
file does not get updated.
What may I be missing or doing wrong?
Copyright Notice:Content Author:「Van_Paitin」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73216174/why-does-rails-generate-a-schema-rb-file-even-with-schema-format-set-to-sql