MySQL: Fix schema dumping
set columns correctly
A cast type on columns is not always the same with
The text was updated successfully, but these errors were encountered:
`enum` and `set` are typed cast as `:string`, but currently the `:string` type is incorrectly reused for schema dumping. A cast type on columns is not always the same with `sql_type`, this fixes schema dumping `enum` and `set` columns to use `sql_type` instead of `type` correctly.
Before rails#36604, `enum` and `set` columns were incorrectly dumped as a `string` column. If an `enum` column is defined as `foo enum('apple','orange')`, it was dumped as `t.string :foo, limit: 6`, the `limit: 6` is seemed to restrict invalid string longer than `'orange'`. But now, `enum` and `set` columns are correctly dumped as `enum` and `set` columns, the limit as longest element is no longer used.