

Rails deprecates `db:structure:load` and `db:structure:dump` tasks
source link: https://blog.saeloun.com/2020/09/30/rails-deprecates-db-structure-commands
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Rails has
deprecated
db:structure:load
and db:structure:dump
tasks.
Before
config.active_record.schema_format
controls the format for dumping the database schema to a file.
:ruby
(default) and :sql
are the valid options for this config.
Running rails db:schema:{dump,load}
will dump or load db/schema.rb file
and
rails db:structure:{dump,load}
will dump or load db/structure.sql file,
regardless of value specified for config.active_record.schema_format
.
After
Both the commands,
rails db:schema:{dump,load}
and
rails db:structure:{dump,load}
will run
rails db:schema:{dump,load}
depending on the value specified for config.active_record.schema_format
.
So running, rails db:schema:dump
or rails db:structure:dump
will dump db/schema.rb
file.
If we specify :sql
as the value for config.active_record.schema_format
,
running rails db:schema:dump
or rails db:structure:dump
will dump db/stucture.sql
file.
Running rails db:structure:{dump,load}
will result in a deprecation warning,
as these commands will be removed in Rails 6.2:
DEPRECATION WARNING: Using `bin/rails db:structure:load` is deprecated and will be removed in Rails 6.2.
Configure the format using `config.active_record.schema_format = :sql` to use `structure.sql`
and
run `bin/rails db:schema:load` instead
Note: config.active_support.deprecation = :stderr
has to be set for above deprecation message to show up.
Recommend
-
123
Firefox for Android loses one of its most popular extensions as LastPass pulls the plug on the web browser with less than 1 % market share on Android.
-
11
MySQL Shell Dump & Load part 4: Dump Instance & Schemas MySQL Shell 8.0.21 comes with two utilities which can be used to perform logica...
-
4
Copy link Contributor alberto-mota c...
-
8
How do I load a dump file into my Subversion repository? Subversion has been removed from the DreamHost panel. If you had previously configured Subversion on your domain, it will continue t...
-
4
rails dump/restore数据 欢迎转载,请支持原创,保留原文链接:blog.ilibrary.me 可以通过gem
-
12
Microsoft Officially Deprecates UWPAn Elite CafeMedia Tech Publisher
-
7
Copy link Member eileencodes
-
6
In this blog post, I will try to cover a few du...
-
8
MySQL Shell Dump & Load and Compression Skip to Main Content...
-
4
Microsoft deprecates Windows Mixed Reality, several headsets could become e-waste Required apps remain available for a few more years By
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK