Closed jquiyula closed 5 years ago
I am connected to AWS RDS MySQL Engine version 5.7.17
I was able to fix the Issue.
I created a file under /config/initializers called abstract_mysql_adapter.rb with the following code:
require 'active_record/connection_adapters/mysql2_adapter' class ActiveRecord::ConnectionAdapters::Mysql2Adapter NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY" end
Caused by: Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in'
_query' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in
block in query' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:inhandle_interrupt' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in
query' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:287:inblock in execute' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:435:in
block in log' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activesupport-4.0.3/lib/active_support/notifications/instrumenter.rb:20:ininstrument' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:430:in
log' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:287:inexecute' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/mysql2_adapter.rb:222:in
execute' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:190:increate_table' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:471:in
create_table' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:625:inblock in method_missing' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:597:in
block in say_with_time' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:597:insay_with_time' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:617:in
method_missing' /home/ec2-user/fluxday/db/migrate/20140313044626_create_projects.rb:3:inchange' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:571:in
exec_migration' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:555:inblock (2 levels) in migrate' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:554:in
block in migrate' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:inwith_connection' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:553:in
migrate' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:709:inmigrate' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:959:in
block in execute_migration_in_transaction' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:1007:inddl_transaction' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:958:in
execute_migration_in_transaction' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:920:inblock in migrate' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:916:in
each' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:916:inmigrate' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:764:in
up' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/migration.rb:742:inmigrate' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/activerecord-4.0.3/lib/active_record/railties/databases.rake:42:in
block (2 levels) in <top (required)>' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/gems/rake-12.3.2/exe/rake:27:in<top (required)>' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/bin/ruby_executable_hooks:24:in
eval' /home/ec2-user/.rvm/gems/ruby-2.1.0@fluxday/bin/ruby_executable_hooks:24:in `