Skip to content

Instantly share code, notes, and snippets.

@skorth
Created January 12, 2016 08:28
Show Gist options
  • Save skorth/7e4ae5c6b3da7607a953 to your computer and use it in GitHub Desktop.
Save skorth/7e4ae5c6b3da7607a953 to your computer and use it in GitHub Desktop.
Remove `DEFAULT NULL` for primary key column to support MySQL 5.7.3
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
end
@skorth
Copy link
Author

skorth commented Jan 12, 2016

Based on rails/rails#13247 - just add it as initializers/abstract_mysql_adapter.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment