Skip to content

Commit

Permalink
fix(PostgreSQL omit dropped columns in getListTableColumnsSQL (pg_att…
Browse files Browse the repository at this point in the history
…ribute table) to avoid ........pg.dropped.x....... - test fix

Signed-off-by: Kamil Michalak <[email protected]>
  • Loading branch information
kamil-michalak committed Dec 22, 2023
1 parent dbf2b62 commit 32d21c2
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tests/Functional/TableDropColumnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ protected function setUp(): void

$platform = $this->connection->getDatabasePlatform();

$table->addIndex(['test_column1', 'test_column2'], 'test');
// some db engines dont allow drop column which belongs to index but on pgsql it leave pg_attribute with attisdropped=true so we can test it

Check warning on line 25 in tests/Functional/TableDropColumnTest.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (8.2)

Line exceeds 120 characters; contains 148 characters
if ($platform instanceof PostgreSQLPlatform) {
$table->addIndex(['test_column1', 'test_column2'], 'test');
}

$this->dropAndCreateTable($table);

// some db engine dont allow drop column which belongs to index but on pgsql it leave pg_attribute with attisdropped=true so we can test it
try {
$this->connection->executeStatement('ALTER TABLE write_table DROP COLUMN test_column1');
} catch (Throwable $e) {
$table->dropIndex('test');
$this->connection->executeStatement('ALTER TABLE write_table DROP COLUMN test_column1');
}
$this->connection->executeStatement('ALTER TABLE write_table DROP COLUMN test_column1');
}

public function testPgSqlPgAttributeTable(): void
Expand Down

0 comments on commit 32d21c2

Please sign in to comment.