Closed mattbrictson closed 8 years ago
Specs are green on Mysql 5.6.
I know Rails 3.2 has an issue with Mysql 5.7+ and you might be seeing that: https://github.com/rails/rails/pull/13247
There's a monkey patch in that link that might help.
Thanks, I'll look into that. I never use Mysql for actual projects, so I'm not familiar with the ins and outs of the various versions.
OK, I added this quick-and-dirty patch to active_type.rb
in my working copy to allow it to work with Mysql 5.7+.
if ActiveRecord::VERSION::STRING == '3.2.22'
begin
require "mysql2"
require "active_record/connection_adapters/abstract_mysql_adapter"
class ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter
NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
end
rescue LoadError
end
end
I am trying to run the specs as instructed in the README using
rake all:spec
.All specs for all gemfiles pass, with the exception of
Gemfile.3.2.mysql2
. I get anActiveRecord::StatementInvalid
error whenspec/support/database.rb
is trying to create the tables in the database:Again, this works fine for sqlite, pg, and for
Gemfile.4.2.1.mysql2
. It is onlyGemfile.3.2.mysql2
that has the problem. Any ideas?Full backtrace: