From 7a6a668f93e4aec7b3e5ea7e44b6e8199bb6088f Mon Sep 17 00:00:00 2001 From: Tigrov Date: Mon, 29 Jul 2024 16:26:25 +0700 Subject: [PATCH 1/2] Refactor `bit` type --- src/Schema.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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]; From 24133d83ca897d64aa294aec4be5acba5707d5ac Mon Sep 17 00:00:00 2001 From: Tigrov Date: Mon, 29 Jul 2024 17:14:23 +0700 Subject: [PATCH 2/2] Add line to CHANGELOG.md [skip ci] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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