Sql syntax problem running migrate in ruby on Rails(schema_migrations)

Asked

Viewed 12 times

0

all blz? I have a problem trying to upload an application in Rails, when I run the command bundle exec rake db:migrate it gives me a syntax error when creating the schema_migrations table. Follow the error: Activerecord::Statementinvalid: Mysql2::Error: You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right syntax to use near 'string NOT NULL PRIMARY KEY)' at line 1: CREATE TABLE schema_migrations (version STRING NOT NULL PRIMARY KEY)

I’m doing a ruby and Rails update. The current version is as follows: Rails 5.2.6 and Ruby 2.5.8p224

In the initializer folder I already own the file abstract_mysql2_adapter that I request the shipment in enviroment.Rb

Content of abstract_mysql2_adapter :

require 'active_record/connection_adapters/mysql2_adapter'

class ActiveRecord::ConnectionAdapters::Mysql2Adapter
  NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
end

And I have no migrate to that table.

Version of the Gems:

mysql2 (0.5.3)

Docker mysql image: mysql:5.6

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.