File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed
tests/Functional/Schema/MySQL Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -191,12 +191,6 @@ protected function _getPortableTableColumnDefinition($tableColumn)
191
191
$ tableColumn ['comment ' ] = $ this ->removeDoctrineTypeFromComment ($ tableColumn ['comment ' ], $ type );
192
192
}
193
193
194
- // Check underlying database type where doctrine type is inferred from DC2Type comment
195
- // and set a flag if it is not as expected.
196
- if ($ origType !== $ type && $ this ->expectedDbType ($ type , $ tableColumn ) !== $ dbType ) {
197
- $ tableColumn ['declarationMismatch ' ] = true ;
198
- }
199
-
200
194
switch ($ dbType ) {
201
195
case 'char ' :
202
196
case 'binary ' :
@@ -296,6 +290,12 @@ protected function _getPortableTableColumnDefinition($tableColumn)
296
290
$ column ->setPlatformOption ('declarationMismatch ' , $ tableColumn ['declarationMismatch ' ]);
297
291
}
298
292
293
+ // Check underlying database type where doctrine type is inferred from DC2Type comment
294
+ // and set a flag if it is not as expected.
295
+ if ($ origType !== $ type && $ this ->expectedDbType ($ type , $ options ) !== $ dbType ) {
296
+ $ column ->setPlatformOption ('declarationMismatch ' , true );
297
+ }
298
+
299
299
return $ column ;
300
300
}
301
301
Original file line number Diff line number Diff line change 6
6
use Doctrine \DBAL \Platforms \AbstractMySQLPlatform ;
7
7
use Doctrine \DBAL \Platforms \AbstractPlatform ;
8
8
use Doctrine \DBAL \Platforms \MariaDb1043Platform ;
9
+ use Doctrine \DBAL \Platforms \MySQL80Platform ;
9
10
use Doctrine \DBAL \Schema \AbstractSchemaManager ;
10
11
use Doctrine \DBAL \Schema \Column ;
11
12
use Doctrine \DBAL \Schema \Comparator ;
@@ -148,9 +149,29 @@ public function testImplicitColumnCharset(): void
148
149
));
149
150
}
150
151
152
+ public function testSimpleArrayTypeNonChangeNotDetected (): void
153
+ {
154
+ $ table = new Table ('comparator_test ' );
155
+
156
+ $ table ->addColumn ('simple_array_col ' , Types::SIMPLE_ARRAY , ['length ' => 255 ]);
157
+ $ this ->dropAndCreateTable ($ table );
158
+
159
+ self ::assertFalse (ComparatorTestUtils::diffFromActualToDesiredTable (
160
+ $ this ->schemaManager ,
161
+ $ this ->comparator ,
162
+ $ table ,
163
+ ));
164
+
165
+ self ::assertFalse (ComparatorTestUtils::diffFromDesiredToActualTable (
166
+ $ this ->schemaManager ,
167
+ $ this ->comparator ,
168
+ $ table ,
169
+ ));
170
+ }
171
+
151
172
public function testMariaDb1043NativeJsonUpgradeDetected (): void
152
173
{
153
- if (! $ this ->platform instanceof MariaDb1043Platform) {
174
+ if (! $ this ->platform instanceof MariaDb1043Platform && ! $ this -> platform instanceof MySQL80Platform ) {
154
175
self ::markTestSkipped ();
155
176
}
156
177
You can’t perform that action at this time.
0 commit comments