Skip to content

Commit 799bd47

Browse files
committed
Add functional test
1 parent 2e6fdb2 commit 799bd47

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/Functional/Schema/MySQLSchemaManagerTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,29 @@ public function testSchemaDiffWithCustomColumnTypeWhileDatabaseTypeDiffers(): vo
871871
);
872872
}
873873

874+
public function testMigrateOldBoolean(): void
875+
{
876+
$this->connection->executeStatement('DROP TABLE IF EXISTS table_with_old_boolean');
877+
$this->connection->executeStatement(
878+
'CREATE TABLE table_with_old_boolean (val TINYINT(1) NOT NULL)',
879+
);
880+
881+
$onlineTable = $this->schemaManager->introspectTableByUnquotedName('table_with_old_boolean');
882+
$targetTable = Table::editor()
883+
->setUnquotedName('table_with_old_boolean')
884+
->setColumns(
885+
Column::editor()
886+
->setUnquotedName('val')
887+
->setTypeName(Types::BOOLEAN)
888+
->create(),
889+
)
890+
->create();
891+
892+
$diff = $this->schemaManager->createComparator()->compareTables($onlineTable, $targetTable);
893+
894+
self::assertTrue($diff->isEmpty(), 'Tables should be identical.');
895+
}
896+
874897
public function getExpectedDefaultSchemaName(): ?string
875898
{
876899
return null;

0 commit comments

Comments
 (0)