{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/9324","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/9324/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/9324/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/9324/events","html_url":"https://github.com/yiisoft/yii2/pull/9324","id":99236729,"number":9324,"title":"Fix mysql QueryBuilder boolean type","user":{"login":"mj4444ru","id":9354685,"avatar_url":"https://avatars.githubusercontent.com/u/9354685?v=3","gravatar_id":"","url":"https://api.github.com/users/mj4444ru","html_url":"https://github.com/mj4444ru","followers_url":"https://api.github.com/users/mj4444ru/followers","following_url":"https://api.github.com/users/mj4444ru/following{/other_user}","gists_url":"https://api.github.com/users/mj4444ru/gists{/gist_id}","starred_url":"https://api.github.com/users/mj4444ru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mj4444ru/subscriptions","organizations_url":"https://api.github.com/users/mj4444ru/orgs","repos_url":"https://api.github.com/users/mj4444ru/repos","events_url":"https://api.github.com/users/mj4444ru/events{/privacy}","received_events_url":"https://api.github.com/users/mj4444ru/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-05T15:51:28Z","updated_at":"2015-08-06T14:13:54Z","closed_at":"2015-08-05T19:49:28Z","pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/9324","html_url":"https://github.com/yiisoft/yii2/pull/9324","diff_url":"https://github.com/yiisoft/yii2/pull/9324.diff","patch_url":"https://github.com/yiisoft/yii2/pull/9324.patch"},"body":"The problem is that yii type boolean type is considered mysql bit (1), and in QueryBuilder it is incorrect. When we create a migration using Schema :: TYPE_BOOLEAN, database type we get Schema :: TYPE_SMALLINT, and the model of type integer.\r\n\r\n/framework/db/mysql/Schema.php\r\n\r\nif ($column->size === 1 && $type === 'bit') {\r\n    $column->type = 'boolean';\r\n}\r\n\r\n/framework/db/mysql/QueryBuilder.php\r\n\r\npublic $typeMap = [\r\n...\r\nSchema::TYPE_BOOLEAN => 'tinyint(1)',\r\n...\r\n];"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/128382587","html_url":"https://github.com/yiisoft/yii2/pull/9324#issuecomment-128382587","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/9324","id":128382587,"user":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T14:13:54Z","updated_at":"2015-08-06T14:13:54Z","body":"it considers bit(1) and tinyint(1), what is the problem?"}}