Skip to content

Instantly share code, notes, and snippets.

@mmichael0413
Created October 17, 2016 15:33
Show Gist options
  • Save mmichael0413/29dedb60806e997a651d88180ad896a7 to your computer and use it in GitHub Desktop.
Save mmichael0413/29dedb60806e997a651d88180ad896a7 to your computer and use it in GitHub Desktop.
Initializer to fix Mysql2::Error: Specified key was too long; max key length is 767 bytes
require 'active_record/connection_adapters/abstract_mysql_adapter'
module ActiveRecord
module ConnectionAdapters
class AbstractMysqlAdapter
NATIVE_DATABASE_TYPES[:string] = { :name => "varchar", :limit => 191 }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment