@@ -70,19 +70,7 @@ public function columnTypes()
70
70
],
71
71
];
72
72
73
- /*
74
- * TODO Remove in Yii 2.1
75
- *
76
- * Disabled due bug in MySQL extension
77
- * @link https://bugs.php.net/bug.php?id=70384
78
- */
79
- if (version_compare (PHP_VERSION , '5.6 ' , '>= ' )) {
80
- $ columns [] = [
81
- Schema::TYPE_JSON ,
82
- $ this ->json (),
83
- "json " ,
84
- ];
85
- }
73
+ $ columns [] = [Schema::TYPE_JSON , $ this ->json (), "json " ];
86
74
87
75
return array_merge (parent ::columnTypes (), $ this ->columnTimeTypes (), $ columns );
88
76
}
@@ -125,28 +113,25 @@ public function columnTimeTypes()
125
113
/**
126
114
* @link https://github.com/yiisoft/yii2/issues/14367
127
115
*/
128
- $ mysqlVersion = $ this ->getDb ()->getSlavePdo (true )->getAttribute (\PDO ::ATTR_SERVER_VERSION );
129
- $ supportsFractionalSeconds = version_compare ($ mysqlVersion ,'5.6.4 ' , '>= ' );
130
- if ($ supportsFractionalSeconds ) {
131
- $ expectedValues = [
132
- 'datetime(0) NOT NULL ' ,
133
- 'datetime(0) ' ,
134
- 'time(0) NOT NULL ' ,
135
- 'time(0) ' ,
136
- 'timestamp(0) NOT NULL ' ,
137
- 'timestamp(0) NULL DEFAULT NULL ' ,
138
- ];
116
+ $ expectedValues = [
117
+ 'datetime(0) NOT NULL ' ,
118
+ 'datetime(0) ' ,
119
+ 'time(0) NOT NULL ' ,
120
+ 'time(0) ' ,
121
+ 'timestamp(0) NOT NULL ' ,
122
+ 'timestamp(0) NULL DEFAULT NULL ' ,
123
+ ];
139
124
140
- foreach ($ expectedValues as $ index => $ expected ) {
141
- $ columns [$ index ][2 ] = $ expected ;
142
- }
125
+ foreach ($ expectedValues as $ index => $ expected ) {
126
+ $ columns [$ index ][2 ] = $ expected ;
143
127
}
144
128
145
129
/**
146
130
* @link https://github.com/yiisoft/yii2/issues/14834
147
131
*/
148
132
$ sqlModes = $ this ->getConnection (false )->createCommand ('SELECT @@sql_mode ' )->queryScalar ();
149
133
$ sqlModes = explode (', ' , $ sqlModes );
134
+
150
135
if (in_array ('NO_ZERO_DATE ' , $ sqlModes , true )) {
151
136
$ this ->markTestIncomplete (
152
137
"MySQL doesn't allow the 'TIMESTAMP' column definition when the NO_ZERO_DATE mode enabled. " .
@@ -156,7 +141,7 @@ public function columnTimeTypes()
156
141
$ columns [] = [
157
142
Schema::TYPE_TIMESTAMP ,
158
143
$ this ->timestamp (),
159
- $ supportsFractionalSeconds ? 'timestamp(0) ' : ' timestamp ' ,
144
+ 'timestamp(0) ' ,
160
145
];
161
146
}
162
147
0 commit comments