Project

General

Profile

Actions

Defect #38199

closed

Fix deprecation warning for db:structure:dump in db:migrate when using sql schema format

Added by Dmitry Makurin about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Running db:migrate using sql schema format shows the deprecation warning:

DEPRECATION WARNING: Using `bin/rails db:structure:dump` is deprecated and will be removed in Rails 7.0. Configure the format using `config.active_record.schema_format = :sql` to use `structure.sql` and run `bin/rails db:schema:dump` instead. (called from block (3 levels) in <top (required)> at lib/tasks/redmine.rake:160)

Redmine invokes db:schema/structures:dump to dump plugins migrations.


Files

31485.patch (538 Bytes) 31485.patch Go MAEDA, 2023-01-20 03:46
38199_v2.patch (697 Bytes) 38199_v2.patch Dmitry Makurin , 2023-01-20 16:19

Related issues

Related to Redmine - Patch #31485: Add support for :sql ActiveRecord::Base.schema_format in redmine:plugins:migrateClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA about 1 year ago

  • Related to Patch #31485: Add support for :sql ActiveRecord::Base.schema_format in redmine:plugins:migrate added
Actions #2

Updated by Go MAEDA about 1 year ago

  • Category set to Rails support
  • Status changed from New to Confirmed

Steps to reproduce:

$ echo 'config.active_record.schema_format = :sql' >> config/additional_environment.rb
$ bin/rake redmine:plugins:migrate

Actions #3

Updated by Go MAEDA about 1 year ago

Setting the target version to 5.0.5.

Actions #4

Updated by Go MAEDA about 1 year ago

  • Subject changed from Using `bin/rails db:structure:dump` is deprecated and will be removed in Rails 7.0. to Fix "DEPRECATION WARNING: Using `bin/rails db:structure:dump`" when migrating plugins using sql schema format
Actions #5

Updated by Dmitry Makurin about 1 year ago

I guess we need to provide backward compatibility for Rails 6.1.
db:structure:dump will be removed only in Rails 7.0 but the current trunk works on 6.1+.
Attaching a new patch 38199_v2.patch.

Actions #6

Updated by Go MAEDA about 1 year ago

  • Target version changed from 5.0.5 to 5.1.0
Actions #7

Updated by Go MAEDA about 1 year ago

  • Target version changed from 5.1.0 to 5.0.5
Actions #8

Updated by Go MAEDA about 1 year ago

Dmitry Makurin wrote:

I guess we need to provide backward compatibility for Rails 6.1.
db:structure:dump will be removed only in Rails 7.0 but the current trunk works on 6.1+.
Attaching a new patch 38199_v2.patch.

I think the first patch work with Rails 6.1. It seems that db:schema:dump generates db/structure.sql also with Rails 6.1.

$ rm db/structure.sql
ls db/structure.sql 
ls: db/structure.sql: No such file or directory
$ bin/rake redmine:plugins:migrate
$ ls db/structure.sql 
db/structure.sql
Actions #9

Updated by Go MAEDA about 1 year ago

  • Subject changed from Fix "DEPRECATION WARNING: Using `bin/rails db:structure:dump`" when migrating plugins using sql schema format to Fix deprecation warning for db:structure:dump in db:migrate when using sql schema format
  • Status changed from Confirmed to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix. Thank you.

Actions #10

Updated by Go MAEDA about 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF