• R
    Default engine `ENGINE=InnoDB` is no longer dumped to make schema more agnostic · 3c6be5e5
    Ryuta Kamizono 提交于
    5 years ago, I made dumping full table options at #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 #26209.
    Closes #29472.
    
    See also #33608, #33853, and #34742.
    3c6be5e5
schema_creation.rb 5.6 KB