Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Oct 9, 2024
1 parent 43db876 commit 7e37fff
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/Column/ColumnDefinitionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use Yiisoft\Db\QueryBuilder\AbstractColumnDefinitionBuilder;
use Yiisoft\Db\Schema\Column\ColumnSchemaInterface;

use function ceil;

final class ColumnDefinitionBuilder extends AbstractColumnDefinitionBuilder
{
protected const AUTO_INCREMENT_KEYWORD = 'IDENTITY';
Expand Down Expand Up @@ -46,22 +48,6 @@ final class ColumnDefinitionBuilder extends AbstractColumnDefinitionBuilder
'numeric',
];

protected function buildType(ColumnSchemaInterface $column): string
{
if ($column->getType() === 'bit' && $column->getDbType() === null) {
match ($column->getSize()) {
1 => 'bit',
8 => 'tinyint',
16 => 'smallint',
32 => 'int',
64 => 'bigint',
default => 'varbinary',
};
}

return parent::buildType($column);
}

protected function getDbType(ColumnSchemaInterface $column): string
{
/** @psalm-suppress DocblockTypeContradiction */
Expand Down

0 comments on commit 7e37fff

Please sign in to comment.