Skip to content

Commit

Permalink
Remove ColumnInterface (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov authored Jan 8, 2025
1 parent 4c2344e commit 5e75c14
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 176 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Enh #366: Refactor `Quoter::quoteValue()` method (@Tigrov)
- Chg #368: Update `QueryBuilder` constructor (@Tigrov)
- Enh #367: Use `ColumnDefinitionBuilder` to generate table column SQL representation (@Tigrov)
- Enh #371: Remove `ColumnInterface` (@Tigrov)

## 1.2.0 March 21, 2024

Expand Down
70 changes: 0 additions & 70 deletions src/Column.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
namespace Yiisoft\Db\Mysql;

use Yiisoft\Db\Connection\ServerInfoInterface;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Constant\PseudoType;
use Yiisoft\Db\Mysql\Column\ColumnDefinitionBuilder;
use Yiisoft\Db\QueryBuilder\AbstractQueryBuilder;
use Yiisoft\Db\Schema\QuoterInterface;
Expand All @@ -17,36 +15,6 @@
*/
final class QueryBuilder extends AbstractQueryBuilder
{
/**
* @psalm-var string[] $typeMap Mapping from abstract column types (keys) to physical column types (values).
*/
protected array $typeMap = [
PseudoType::PK => 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY',
PseudoType::UPK => 'int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY',
PseudoType::BIGPK => 'bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY',
PseudoType::UBIGPK => 'bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY',
ColumnType::CHAR => 'char(1)',
ColumnType::STRING => 'varchar(255)',
ColumnType::TEXT => 'text',
ColumnType::TINYINT => 'tinyint(3)',
ColumnType::SMALLINT => 'smallint(6)',
ColumnType::INTEGER => 'int(11)',
ColumnType::BIGINT => 'bigint(20)',
ColumnType::FLOAT => 'float',
ColumnType::DOUBLE => 'double',
ColumnType::DECIMAL => 'decimal(10,0)',
ColumnType::DATE => 'date',
ColumnType::BINARY => 'blob',
ColumnType::BOOLEAN => 'bit(1)',
ColumnType::MONEY => 'decimal(19,4)',
ColumnType::JSON => 'json',
ColumnType::DATETIME => 'datetime(0)',
ColumnType::TIMESTAMP => 'timestamp(0)',
ColumnType::TIME => 'time(0)',
ColumnType::UUID => 'binary(16)',
PseudoType::UUID_PK => 'binary(16) PRIMARY KEY',
];

public function __construct(QuoterInterface $quoter, SchemaInterface $schema, ServerInfoInterface $serverInfo)
{
parent::__construct(
Expand Down
9 changes: 0 additions & 9 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
use Yiisoft\Db\Exception\InvalidConfigException;
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\Helper\DbArrayHelper;
use Yiisoft\Db\Mysql\Column\ColumnBuilder;
use Yiisoft\Db\Mysql\Column\ColumnFactory;
use Yiisoft\Db\Schema\Builder\ColumnInterface;
use Yiisoft\Db\Schema\Column\ColumnFactoryInterface;
use Yiisoft\Db\Schema\Column\ColumnSchemaInterface;
use Yiisoft\Db\Schema\TableSchemaInterface;
Expand Down Expand Up @@ -73,13 +71,6 @@
*/
final class Schema extends AbstractPdoSchema
{
/** @deprecated Use {@see ColumnBuilder} instead. Will be removed in 2.0. */
public function createColumn(string $type, array|int|string $length = null): ColumnInterface
{
/** @psalm-suppress DeprecatedClass */
return new Column($type, $length);
}

public function getColumnFactory(): ColumnFactoryInterface
{
return new ColumnFactory();
Expand Down
26 changes: 0 additions & 26 deletions tests/ColumnSchemaBuilderTest.php

This file was deleted.

39 changes: 0 additions & 39 deletions tests/Provider/ColumnSchemaBuilderProvider.php

This file was deleted.

0 comments on commit 5e75c14

Please sign in to comment.