From 72c8c3af3a6c4db45a1fec1d76ad40de7ca2948f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 4 Jul 2024 10:26:11 +0200 Subject: [PATCH] fix(tests): Adjust postgres schema diffing Signed-off-by: Joas Schilling --- tests/lib/DB/OCPostgreSqlPlatformTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/lib/DB/OCPostgreSqlPlatformTest.php b/tests/lib/DB/OCPostgreSqlPlatformTest.php index 3ed420df501..73e7cb4ace0 100644 --- a/tests/lib/DB/OCPostgreSqlPlatformTest.php +++ b/tests/lib/DB/OCPostgreSqlPlatformTest.php @@ -1,4 +1,6 @@ createTableAndColumn($sourceSchema, Types::INTEGER); $this->createTableAndColumn($targetSchema, Types::BIGINT); - $comparator = new Comparator(); - $diff = $comparator->compare($sourceSchema, $targetSchema); - $sqlStatements = $diff->toSql($platform); + $comparator = new Comparator($platform); + $diff = $comparator->compareSchemas($sourceSchema, $targetSchema); + $sqlStatements = $platform->getAlterSchemaSQL($diff); $this->assertContains( 'ALTER TABLE poor_yorick ALTER id TYPE BIGINT', - $sqlStatements, - true + $sqlStatements ); $this->assertNotContains( 'ALTER TABLE poor_yorick ALTER id DROP DEFAULT', - $sqlStatements, - true + $sqlStatements ); } - protected function createTableAndColumn($schema, $type) { + protected function createTableAndColumn(Schema $schema, string $type): void { $table = $schema->createTable("poor_yorick"); $table->addColumn('id', $type, [ 'autoincrement' => true,