Skip to content

Commit

Permalink
Refactor bit type (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov authored Aug 2, 2024
1 parent c8b40a5 commit d5c8c68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit d5c8c68

Please sign in to comment.