utf8mb4対応
MySQLのデータベース設定がutf8mb4でこのエラーが発生したら
- ROW_FORMATnのデフォルトをDYNAMIC
config/initializers/ar_innodb_row_format.rb
ActiveSupport.on_load :active_record do
module ActiveRecord::ConnectionAdapters
class AbstractMysqlAdapter
def create_table_with_innodb_row_format(table_name, options = {})
table_options = options.merge(options: 'ENGINE=InnoDB ROW_FORMAT=DYNAMIC')
create_table_without_innodb_row_format(table_name, table_options) do |td|
yield td if block_given?
end
end
alias_method_chain :create_table, :innodb_row_format
end
end
end
- my.cnf
- innodb_file_format = Barracuda
- innodb_file_per_table = 1
- innodb_large_prefix