diff --git a/CHANGELOG.md b/CHANGELOG.md index 5907dd388..24509ea6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ - Enh #464: Load column's check expressions for table schema (@Tigrov) - Bug #467: Fix column definition parsing in cases with parentheses (@vjik) - New #465: Add enumeration column type support (@vjik) +- New #471: Add source of column information (@Tigrov) ## 1.3.0 March 21, 2024 diff --git a/src/Schema.php b/src/Schema.php index 96e678caa..8350e8351 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -4,6 +4,7 @@ namespace Yiisoft\Db\Pgsql; +use Yiisoft\Db\Constant\ColumnInfoSource; use Yiisoft\Db\Constant\ColumnType; use Yiisoft\Db\Constant\ReferentialAction; use Yiisoft\Db\Constraint\Check; @@ -422,7 +423,7 @@ protected function loadResultColumn(array $metadata): ?ColumnInterface $dbType = $metadata['native_type']; - $columnInfo = ['fromResult' => true]; + $columnInfo = ['source' => ColumnInfoSource::QUERY_RESULT]; if (!empty($metadata['table'])) { $columnInfo['table'] = $metadata['table']; @@ -534,6 +535,7 @@ private function loadColumn(array $info): ColumnInterface 'scale' => $info['scale'] !== null ? (int) $info['scale'] : null, 'schema' => $info['schema'], 'size' => $info['size'] !== null ? (int) $info['size'] : null, + 'source' => ColumnInfoSource::TABLE_SCHEMA, 'table' => $info['table'], 'unique' => $info['contype'] === 'u', ];