{"action":"created","issue":{"url":"https://api.github.com/repos/brianmario/mysql2/issues/784","repository_url":"https://api.github.com/repos/brianmario/mysql2","labels_url":"https://api.github.com/repos/brianmario/mysql2/issues/784/labels{/name}","comments_url":"https://api.github.com/repos/brianmario/mysql2/issues/784/comments","events_url":"https://api.github.com/repos/brianmario/mysql2/issues/784/events","html_url":"https://github.com/brianmario/mysql2/issues/784","id":171816243,"number":784,"title":"Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead:","user":{"login":"heimatau","id":6117601,"avatar_url":"https://avatars.githubusercontent.com/u/6117601?v=3","gravatar_id":"","url":"https://api.github.com/users/heimatau","html_url":"https://github.com/heimatau","followers_url":"https://api.github.com/users/heimatau/followers","following_url":"https://api.github.com/users/heimatau/following{/other_user}","gists_url":"https://api.github.com/users/heimatau/gists{/gist_id}","starred_url":"https://api.github.com/users/heimatau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heimatau/subscriptions","organizations_url":"https://api.github.com/users/heimatau/orgs","repos_url":"https://api.github.com/users/heimatau/repos","events_url":"https://api.github.com/users/heimatau/events{/privacy}","received_events_url":"https://api.github.com/users/heimatau/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-18T04:37:10Z","updated_at":"2016-08-18T06:07:41Z","closed_at":"2016-08-18T06:07:41Z","body":"I'm using Rails 4.0.0, mySQL 5.7.14, activerecord (5.0.0.1, 4.0.0) and gem mysql2 0.3.18. And I keep running in circles. If I need to share more info, just ask and I'll update it here.\r\n\r\nFirst issue that keeps coming up is:\r\n\r\n> Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead:\r\n\r\nAnd my second issue, i currently can't reproduce it but it boils down to trying [this](http://stackoverflow.com/a/34555109/3685632) which ultimately causes the error: Mysql2.....(NameError). And if I try a 'super' snippet, that is similar to the SO answer (I miss placed it but code is below for the config/initializers/abstract_mysql2_adapter.rb file), then I get a super mismatch.\r\n\r\n`class ActiveRecord::ConnectionAdapters::Mysql2Adapter\r\n def modify_types(types)\r\n   super\r\n   types[:primary_key] = \"int(11) auto_increment PRIMARY KEY\"\r\n   types\r\n end\r\nend`\r\n\r\nI'd like to use Rails 4 since that's what the lesson is in. How do I fix this and/or how would I find the answer?"},"comment":{"url":"https://api.github.com/repos/brianmario/mysql2/issues/comments/240632416","html_url":"https://github.com/brianmario/mysql2/issues/784#issuecomment-240632416","issue_url":"https://api.github.com/repos/brianmario/mysql2/issues/784","id":240632416,"user":{"login":"heimatau","id":6117601,"avatar_url":"https://avatars.githubusercontent.com/u/6117601?v=3","gravatar_id":"","url":"https://api.github.com/users/heimatau","html_url":"https://github.com/heimatau","followers_url":"https://api.github.com/users/heimatau/followers","following_url":"https://api.github.com/users/heimatau/following{/other_user}","gists_url":"https://api.github.com/users/heimatau/gists{/gist_id}","starred_url":"https://api.github.com/users/heimatau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heimatau/subscriptions","organizations_url":"https://api.github.com/users/heimatau/orgs","repos_url":"https://api.github.com/users/heimatau/repos","events_url":"https://api.github.com/users/heimatau/events{/privacy}","received_events_url":"https://api.github.com/users/heimatau/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T06:07:41Z","updated_at":"2016-08-18T06:07:41Z","body":"Thank you! That worked nicely. So far, I haven't seen any issues."}}
{"actor":{"display_login":"heimatau"}}