Commit 8ecceb39 by Qiang Xue

Fixes #2210: Mysql driver will now treat `tinyint(1)` as integer instead of boolean

parent e1a8fa1d
...@@ -134,6 +134,7 @@ Yii Framework 2 Change Log ...@@ -134,6 +134,7 @@ Yii Framework 2 Change Log
- Chg #2161: Added ability to use `return` in `Widget::run` (samdark) - Chg #2161: Added ability to use `return` in `Widget::run` (samdark)
- Chg #2173: Removed `StringHelper::diff()`, Moved `phpspec/php-diff` dependency from `yiisoft/yii2` to `yiisoft/yii2-gii` (samdark) - Chg #2173: Removed `StringHelper::diff()`, Moved `phpspec/php-diff` dependency from `yiisoft/yii2` to `yiisoft/yii2-gii` (samdark)
- Chg #2175: QueryBuilder will now append UNION statements at the end of the primary SQL (qiangxue) - Chg #2175: QueryBuilder will now append UNION statements at the end of the primary SQL (qiangxue)
- Chg #2210: Mysql driver will now treat `tinyint(1)` as integer instead of boolean (qiangxue)
- Chg: Renamed `yii\jui\Widget::clientEventsMap` to `clientEventMap` (qiangxue) - Chg: Renamed `yii\jui\Widget::clientEventsMap` to `clientEventMap` (qiangxue)
- Chg: Renamed `ActiveRecord::getPopulatedRelations()` to `getRelatedRecords()` (qiangxue) - Chg: Renamed `ActiveRecord::getPopulatedRelations()` to `getRelatedRecords()` (qiangxue)
- Chg: Renamed `attributeName` and `className` to `targetAttribute` and `targetClass` for `UniqueValidator` and `ExistValidator` (qiangxue) - Chg: Renamed `attributeName` and `className` to `targetAttribute` and `targetClass` for `UniqueValidator` and `ExistValidator` (qiangxue)
......
...@@ -153,7 +153,7 @@ class Schema extends \yii\db\Schema ...@@ -153,7 +153,7 @@ class Schema extends \yii\db\Schema
if (isset($values[1])) { if (isset($values[1])) {
$column->scale = (int)$values[1]; $column->scale = (int)$values[1];
} }
if ($column->size === 1 && ($type === 'tinyint' || $type === 'bit')) { if ($column->size === 1 && $type === 'bit') {
$column->type = 'boolean'; $column->type = 'boolean';
} elseif ($type === 'bit') { } elseif ($type === 'bit') {
if ($column->size > 32) { if ($column->size > 32) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment