| @@ 338-352 (lines=15) @@ | ||
| 335 | self::assertTrue($columns['col_unsigned']->getUnsigned()); |
|
| 336 | } |
|
| 337 | ||
| 338 | public function testJsonColumnType() : void |
|
| 339 | { |
|
| 340 | $platform = $this->_sm->getDatabasePlatform(); |
|
| 341 | if ( ! $platform->hasNativeJsonType()) { |
|
| 342 | $this->markTestSkipped("Requires native JSON type"); |
|
| 343 | } |
|
| 344 | ||
| 345 | $table = new Table('test_mysql_json'); |
|
| 346 | $table->addColumn('col_json', 'json'); |
|
| 347 | $this->_sm->dropAndCreateTable($table); |
|
| 348 | ||
| 349 | $columns = $this->_sm->listTableColumns('test_mysql_json'); |
|
| 350 | ||
| 351 | self::assertSame(TYPE::JSON, $columns['col_json']->getType()->getName()); |
|
| 352 | } |
|
| 353 | ||
| 354 | public function testColumnDefaultCurrentTimestamp() : void |
|
| 355 | { |
|
| @@ 1321-1336 (lines=16) @@ | ||
| 1318 | * @group 2782 |
|
| 1319 | * @group 6654 |
|
| 1320 | */ |
|
| 1321 | public function testComparatorShouldNotAddCommentToJsonTypeSinceItIsTheDefaultNow() : void |
|
| 1322 | { |
|
| 1323 | if ( ! $this->_sm->getDatabasePlatform()->hasNativeJsonType()) { |
|
| 1324 | $this->markTestSkipped('This test is only supported on platforms that have native JSON type.'); |
|
| 1325 | } |
|
| 1326 | ||
| 1327 | $this->_conn->executeQuery('CREATE TABLE json_test (parameters JSON NOT NULL)'); |
|
| 1328 | ||
| 1329 | $table = new Table('json_test'); |
|
| 1330 | $table->addColumn('parameters', 'json'); |
|
| 1331 | ||
| 1332 | $comparator = new Comparator(); |
|
| 1333 | $tableDiff = $comparator->diffTable($this->_sm->listTableDetails('json_test'), $table); |
|
| 1334 | ||
| 1335 | self::assertFalse($tableDiff); |
|
| 1336 | } |
|
| 1337 | ||
| 1338 | /** |
|
| 1339 | * @dataProvider commentsProvider |
|