diff --git a/CHANGELOG.md b/CHANGELOG.md index e49c672f..73599c96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Enh #293: Implement `SqlParser` and `ExpressionBuilder` driver classes (@Tigrov) - Chg #306: Remove parameter `$withColumn` from `Quoter::getTableNameParts()` method (@Tigrov) - Chg #308: Replace call of `SchemaInterface::getRawTableName()` to `QuoterInterface::getRawTableName()` (@Tigrov) +- Enh #312: Refactor `bit` type (@Tigrov) ## 1.2.0 March 21, 2024 diff --git a/src/Schema.php b/src/Schema.php index d511c442..b2fcce0b 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -76,7 +76,7 @@ final class Schema extends AbstractPdoSchema /** Exact numbers */ 'bigint' => self::TYPE_BIGINT, 'numeric' => self::TYPE_DECIMAL, - 'bit' => self::TYPE_SMALLINT, + 'bit' => self::TYPE_BOOLEAN, 'smallint' => self::TYPE_SMALLINT, 'decimal' => self::TYPE_DECIMAL, 'smallmoney' => self::TYPE_MONEY, @@ -451,10 +451,6 @@ private function getColumnType(string $dbType, array &$info): string preg_match('/^(\w*)(?:\(([^)]+)\))?/', $dbType, $matches); $dbType = strtolower($matches[1]); - if ($dbType === 'bit') { - return self::TYPE_BOOLEAN; - } - if (!empty($matches[2])) { $values = explode(',', $matches[2], 2); $info['size'] = (int) $values[0];