Skip to content

Commit

Permalink
[PostgreSQL] list partitionned tables
Browse files Browse the repository at this point in the history
  • Loading branch information
nikophil committed Sep 3, 2024
1 parent 7a82524 commit d95aa5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Schema/PostgreSQLSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,9 @@ protected function selectTableColumns(string $databaseName, ?string $tableName =

$conditions = array_merge([
'a.attnum > 0',
"c.relkind = 'r'",
"c.relkind IN('r', 'p')", // 'r' for regular tables - 'p' for partitioned tables

Check warning on line 456 in src/Schema/PostgreSQLSchemaManager.php

View check run for this annotation

Codecov / codecov/patch

src/Schema/PostgreSQLSchemaManager.php#L456

Added line #L456 was not covered by tests
'd.refobjid IS NULL',
'NOT EXISTS (SELECT 1 FROM pg_inherits WHERE inhrelid = c.oid)',

Check warning on line 458 in src/Schema/PostgreSQLSchemaManager.php

View check run for this annotation

Codecov / codecov/patch

src/Schema/PostgreSQLSchemaManager.php#L458

Added line #L458 was not covered by tests
], $this->buildQueryConditions($tableName));

$sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY a.attnum';
Expand Down

0 comments on commit d95aa5d

Please sign in to comment.