Skip to content

Commit 4df4807

Browse files
committed
[2323] add check for mysql 8
1 parent 2d3914c commit 4df4807

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/Phinx/Db/Adapter/MysqlAdapterTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,20 +2842,24 @@ public function testChangeColumnWithAlgorithm(): void
28422842
{
28432843
$this->adapter->connect();
28442844

2845+
if (version_compare($this->adapter->getAttribute(PDO::ATTR_SERVER_VERSION), '8.0.0') === -1) {
2846+
$this->markTestSkipped('Cannot test inplace algorithm on mysql versions less than 8');
2847+
}
2848+
28452849
$table = new Table('items', [], $this->adapter);
2846-
$table->addColumn('description', 'string', ['limit' => 10])
2850+
$table->addColumn('description', 'string', ['limit' => 100])
28472851
->create();
28482852

28492853
$table->changeColumn('description', 'string', [
2850-
'limit' => 20,
2854+
'limit' => 255,
28512855
'algorithm' => MysqlAdapter::ALGORITHM_INPLACE,
28522856
'lock' => MysqlAdapter::LOCK_SHARED,
28532857
])->update();
28542858

28552859
$columns = $this->adapter->getColumns('items');
28562860
foreach ($columns as $column) {
28572861
if ($column->getName() === 'description') {
2858-
$this->assertEquals(200, $column->getLimit());
2862+
$this->assertEquals(255, $column->getLimit());
28592863
}
28602864
}
28612865
}

0 commit comments

Comments
 (0)