diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f493dbd..c5320be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ - Chg #413: Throw exception on "unsigned" column usage (@vjik) - New #415: Add enumeration column type support (@vjik) - New #418: Trim dot in column default value normalization to prevent PHP 8.5+ warnings on large values (@vjik) +- New #420: Add source of column information (@Tigrov) ## 1.2.0 March 21, 2024 diff --git a/src/Schema.php b/src/Schema.php index 3761f767..9876fb27 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -4,6 +4,7 @@ namespace Yiisoft\Db\Mssql; +use Yiisoft\Db\Constant\ColumnInfoSource; use Yiisoft\Db\Constraint\Check; use Yiisoft\Db\Constraint\DefaultValue; use Yiisoft\Db\Constraint\ForeignKey; @@ -166,7 +167,7 @@ protected function loadResultColumn(array $metadata): ?ColumnInterface $dbType = $metadata['sqlsrv:decl_type']; - $columnInfo = ['fromResult' => true]; + $columnInfo = ['source' => ColumnInfoSource::QUERY_RESULT]; if (str_ends_with($dbType, ' identity')) { $columnInfo['autoIncrement'] = true; @@ -395,6 +396,7 @@ private function loadColumn(array $info): ColumnInterface 'scale' => $info['numeric_scale'] !== null ? (int) $info['numeric_scale'] : null, 'schema' => $info['schema'], 'size' => $info['size'] !== null ? (int) $info['size'] : null, + 'source' => ColumnInfoSource::TABLE_SCHEMA, 'table' => $info['table'], 'values' => $this->tryGetEnumValuesFromCheck($info['column_name'], $info['check']), ]);