Prevent "options" from create_table in rail scheme 5

My Rails 5 schema.rbhas a section options:for everyone create_tablethat I don't want. I have:

  create_table "accounts", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|

but I want:

  create_table "accounts", id: false, force: :cascade do |t|

Since this is a generated file, I do not want to manually edit it.

The reason I don't want the section to optionsbe caused is because for the TDD fast loop I want to use SQLite in memory when RAILS_ENV=test, but MySQL is in development and production.

How can I predefine certain parameters of a DB database adapter and put into a schema?

+4
source share
1 answer

Rails 5 violated scheme dump format

Rails 5 , :

1) create_table options, , . MySQL OP.

2) :limit, .

?

1) ActiveRecord DB, , . SQLite DB .

SQLite MySQL .

2) , .

.

ActiveRecord . , DB, SQLite.

MySQL no Rails 5.0, , Rails 5.0:

config/initializers/active_record/schema_dumper.rb

config/initializers/active_record/connection_adapters/abstract/schema_dumper.rb

5-0- Rails, , (1) (2).

, , .

, .

, DB, . : - (

0

Source: https://habr.com/ru/post/1650818/


All Articles