diff --git a/CHANGELOG.md b/CHANGELOG.md index f5bef9f..59014da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ - Chg #378: Throw exception on "unsigned" column usage (@vjik) - Bug #383: Fix column definition parsing in cases with parentheses (@vjik) - New #382: Add enumeration column type support (@vjik) +- New #387: Add source of column information (@Tigrov) ## 1.3.0 March 21, 2024 diff --git a/src/Schema.php b/src/Schema.php index f3d85cf..efb518a 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -6,6 +6,7 @@ use Yiisoft\Db\Cache\SchemaCache; use Yiisoft\Db\Connection\ConnectionInterface; +use Yiisoft\Db\Constant\ColumnInfoSource; use Yiisoft\Db\Constant\ColumnType; use Yiisoft\Db\Constant\ReferentialAction; use Yiisoft\Db\Constraint\Check; @@ -168,7 +169,7 @@ protected function loadResultColumn(array $metadata): ?ColumnInterface default => strtolower((string) $metadata['oci:decl_type']), }; - $columnInfo = ['fromResult' => true]; + $columnInfo = ['source' => ColumnInfoSource::QUERY_RESULT]; if (!empty($metadata['table'])) { $columnInfo['table'] = $metadata['table']; @@ -455,6 +456,7 @@ private function loadColumn(array $info): ColumnInterface 'scale' => $info['data_scale'] !== null ? (int) $info['data_scale'] : null, 'schema' => $info['schema'], 'size' => $info['size'] !== null ? (int) $info['size'] : null, + 'source' => ColumnInfoSource::TABLE_SCHEMA, 'table' => $info['table'], 'unique' => $info['constraint_type'] === 'U', 'values' => $this->tryGetEnumValuesFromCheck($info['column_name'], $info['check']),