Patch #31485

Add support for :sql ActiveRecord::Base.schema_format in redmine:plugins:migrate

Added by Kouhei Sutou 5 months ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Plugin API
Target version:4.1.0

Description

ActiveRecord uses db/schema.rb when ActiveRecord::Base.schema_format is :ruby and db/structure.sql when ActiveRecord::Base.schema_format is :sql.

:sql is needed to use SQL that isn't supported by Active Record's migration API.
For example, WITH of PostgreSQL's CREATE INDEX isn't supported.

I'm using SQL that isn't supported by Active Record's migration API in https://github.com/clear-code/redmine_full_text_search .

db:migrate in Rails supports :ruby and :sql.
https://github.com/rails/rails/blob/master/activerecord/lib/active_record/railties/databases.rake#L91-L93

So it's better that redmine:plugins:migrate also supports :ruby and :sql.

add-support-for-schema-format-sql.diff Magnifier (538 Bytes) Kouhei Sutou, 2019-05-31 10:07

Associated revisions

Revision 18212
Added by Go MAEDA 5 months ago

Add support for :sql ActiveRecord::Base.schema_format in redmine:plugins:migrate (#31485).

Patch by Kouhei Sutou.

History

#1 Updated by Go MAEDA 5 months ago

  • Target version set to 4.1.0

#3 Updated by Go MAEDA 5 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch. Thank you.

Also available in: Atom PDF