Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nesting adapter specific table options #29472

Closed

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Jun 16, 2017

To ignore invalid table options for other adapter.

Fixes #26209.

@matthewd
Copy link
Member

Per #27981 (comment), I don't think we should ignore settings that mean something, and we should instead aim to exclude default settings from the schema dump.

r? @jeremy

@kamipo kamipo force-pushed the nesting_adapter_specific_table_options branch 2 times, most recently from 8062b88 to 79efed0 Compare June 17, 2017 05:11
@kamipo kamipo force-pushed the nesting_adapter_specific_table_options branch 2 times, most recently from 0333c91 to b6ab3b8 Compare July 7, 2017 14:20
@kamipo kamipo force-pushed the nesting_adapter_specific_table_options branch from b6ab3b8 to e0e90a9 Compare August 20, 2017 06:04
@kamipo kamipo force-pushed the nesting_adapter_specific_table_options branch from e0e90a9 to acbbd81 Compare September 4, 2017 22:02
@kamipo kamipo force-pushed the nesting_adapter_specific_table_options branch 2 times, most recently from daf869b to 2c0d274 Compare July 15, 2018 20:48
@kamipo kamipo force-pushed the nesting_adapter_specific_table_options branch from 2c0d274 to 23b1891 Compare September 28, 2018 09:17
@aquadrehz
Copy link

When does this going to merged?

@rails-bot
Copy link

rails-bot bot commented Dec 18, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Dec 18, 2019
@kamipo kamipo removed the stale label Dec 23, 2019
@rails-bot
Copy link

rails-bot bot commented Mar 17, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Mar 17, 2020
To ignore invalid table options for other adapters.

Fixes rails#26209.
@kamipo kamipo force-pushed the nesting_adapter_specific_table_options branch from 23b1891 to 4dc6de9 Compare March 24, 2020 00:07
@rails-bot rails-bot bot removed the stale label Mar 24, 2020
kamipo added a commit to kamipo/rails that referenced this pull request May 23, 2020
…e agnostic

5 years ago, I made dumping full table options at rails#17569, especially to
dump `ENGINE=InnoDB ROW_FORMAT=DYNAMIC` to use utf8mb4 with large key
prefix.

In that time, omitting the default engine `ENGINE=InnoDB` was not useful
since `ROW_FORMAT=DYNAMIC` always remains as long as using utf8mb4 with
large key prefix.

But now, MySQL 5.7.9 has finally changed the default row format to
DYNAMIC, utf8mb4 with large key prefix can be used without dumping the
default engine and the row format explicitly.

So now is a good time to make the default engine is omitted.

Before:

```ruby
create_table "accounts", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", force: :cascade do |t|
end
```

After:

```ruby
create_table "accounts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
end
```

To entirely omit `:options` option to make schema agnostic, I've added
`:charset` and `:collation` table options to exclude `CHARSET` and
`COLLATE` from `:options`.

Fixes rails#26209.
Closes rails#29472.

See also rails#33608, rails#33853, and rails#34742.
@kamipo kamipo deleted the nesting_adapter_specific_table_options branch May 24, 2020 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rails 5 schema.rb adding non-agnostic options. dev mysql -> test sqlite
4 participants