example of rake db:test:prepare failing due to mismatched database columns (int vs bigint) because rails doesnt have a way to assign column type to primary key
-
this is a bare bones app - i only added the migrations and mysql gem
-
to test
-
rake db:create
-
rake db:migrate
-
rake db:test:prepare –trace
-
success!
-
in db/schema.rb change posts.user_id from limit: 4 => limit: 8
-
rake db:test:prepare –trace
-
fail: (errno: 150): ALTER TABLE ‘posts` ADD CONSTRAINT `fk_rails_5b5ddfd518` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)