Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Enh #274: Refactor for compatibility with `yiisoft/db` package (@Tigrov)
- Bug #277: Fix when there is a namespace but the directory does not exist (@Tigrov)
- Chg #279: Use `ColumnBuilder` class to create table column definitions (@Tigrov)
- Enh #282: Remove `ColumnInterface` (@Tigrov)
- Enh #282, #283: Adapt to Yii DB changes (@Tigrov)

## 1.2.0 November 27, 2024

Expand Down
96 changes: 48 additions & 48 deletions src/AbstractMigrationBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
namespace Yiisoft\Db\Migration;

use Yiisoft\Db\Schema\Column\ColumnBuilder;
use Yiisoft\Db\Schema\Column\ColumnSchemaInterface;
use Yiisoft\Db\Schema\Column\ColumnInterface;
use Yiisoft\Db\Schema\SchemaInterface;

/**
* AbstractMigrationBuilder contains shortcut methods to create instances of {@see ColumnSchemaInterface}.
* AbstractMigrationBuilder contains shortcut methods to create instances of {@see ColumnInterface}.
*
* These can be used in database migrations to define database schema types using a PHP interface. This is useful to
* define a schema in a DBMS independent way so that the application may run on different DBMS the same way.
Expand Down Expand Up @@ -45,11 +45,11 @@ public function __construct(private SchemaInterface $schema)
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::bigint()} instead. Will be removed in 2.0.0.
*/
public function bigInteger(int $length = null): ColumnSchemaInterface
public function bigInteger(int $length = null): ColumnInterface
{
return ColumnBuilder::bigint($length);
}
Expand All @@ -61,11 +61,11 @@ public function bigInteger(int $length = null): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::bigPrimaryKey()} instead. Will be removed in 2.0.0.
*/
public function bigPrimaryKey(int $length = null): ColumnSchemaInterface
public function bigPrimaryKey(int $length = null): ColumnInterface
{
return ColumnBuilder::bigPrimaryKey()->size($length);
}
Expand All @@ -75,11 +75,11 @@ public function bigPrimaryKey(int $length = null): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::uuidPrimaryKey()} instead. Will be removed in 2.0.0.
*/
public function uuidPrimaryKey(): ColumnSchemaInterface
public function uuidPrimaryKey(): ColumnInterface
{
return ColumnBuilder::uuidPrimaryKey();
}
Expand All @@ -89,11 +89,11 @@ public function uuidPrimaryKey(): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::uuidPrimaryKey()} instead. Will be removed in 2.0.0.
*/
public function uuidPrimaryKeySequenced(): ColumnSchemaInterface
public function uuidPrimaryKeySequenced(): ColumnInterface
{
return ColumnBuilder::uuidPrimaryKey();
}
Expand All @@ -103,11 +103,11 @@ public function uuidPrimaryKeySequenced(): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::uuid()} instead. Will be removed in 2.0.0.
*/
public function uuid(): ColumnSchemaInterface
public function uuid(): ColumnInterface
{
return ColumnBuilder::uuid();
}
Expand All @@ -119,23 +119,23 @@ public function uuid(): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::binary()} instead. Will be removed in 2.0.0.
*/
public function binary(int $length = null): ColumnSchemaInterface
public function binary(int $length = null): ColumnInterface
{
return ColumnBuilder::binary($length);
}

/**
* Creates a boolean column.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::boolean()} instead. Will be removed in 2.0.0.
*/
public function boolean(): ColumnSchemaInterface
public function boolean(): ColumnInterface
{
return ColumnBuilder::boolean();
}
Expand All @@ -147,23 +147,23 @@ public function boolean(): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::char()} instead. Will be removed in 2.0.0.
*/
public function char(int $length = null): ColumnSchemaInterface
public function char(int $length = null): ColumnInterface
{
return ColumnBuilder::char($length);
}

/**
* Creates a date column.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::date()} instead. Will be removed in 2.0.0.
*/
public function date(): ColumnSchemaInterface
public function date(): ColumnInterface
{
return ColumnBuilder::date();
}
Expand All @@ -176,11 +176,11 @@ public function date(): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::datetime()} instead. Will be removed in 2.0.0.
*/
public function dateTime(int $precision = null): ColumnSchemaInterface
public function dateTime(int $precision = null): ColumnInterface
{
return ColumnBuilder::datetime($precision);
}
Expand All @@ -197,11 +197,11 @@ public function dateTime(int $precision = null): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::decimal()} instead. Will be removed in 2.0.0.
*/
public function decimal(int $precision = null, int $scale = null): ColumnSchemaInterface
public function decimal(int $precision = null, int $scale = null): ColumnInterface
{
return ColumnBuilder::decimal($precision, $scale);
}
Expand All @@ -214,11 +214,11 @@ public function decimal(int $precision = null, int $scale = null): ColumnSchemaI
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::double()} instead. Will be removed in 2.0.0.
*/
public function double(int $precision = null): ColumnSchemaInterface
public function double(int $precision = null): ColumnInterface
{
return ColumnBuilder::double($precision);
}
Expand All @@ -231,11 +231,11 @@ public function double(int $precision = null): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::float()} instead. Will be removed in 2.0.0.
*/
public function float(int $precision = null): ColumnSchemaInterface
public function float(int $precision = null): ColumnInterface
{
return ColumnBuilder::float($precision);
}
Expand All @@ -247,23 +247,23 @@ public function float(int $precision = null): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::integer()} instead. Will be removed in 2.0.0.
*/
public function integer(int $length = null): ColumnSchemaInterface
public function integer(int $length = null): ColumnInterface
{
return ColumnBuilder::integer($length);
}

/**
* Creates a JSON column.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::json()} instead. Will be removed in 2.0.0.
*/
public function json(): ColumnSchemaInterface
public function json(): ColumnInterface
{
return ColumnBuilder::json();
}
Expand All @@ -280,11 +280,11 @@ public function json(): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::money()} instead. Will be removed in 2.0.0.
*/
public function money(int $precision = null, int $scale = null): ColumnSchemaInterface
public function money(int $precision = null, int $scale = null): ColumnInterface
{
return ColumnBuilder::money($precision, $scale);
}
Expand All @@ -296,11 +296,11 @@ public function money(int $precision = null, int $scale = null): ColumnSchemaInt
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::primaryKey()} instead. Will be removed in 2.0.0.
*/
public function primaryKey(int $length = null): ColumnSchemaInterface
public function primaryKey(int $length = null): ColumnInterface
{
return ColumnBuilder::primaryKey()->size($length);
}
Expand All @@ -312,11 +312,11 @@ public function primaryKey(int $length = null): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::smallint()} instead. Will be removed in 2.0.0.
*/
public function smallInteger(int $length = null): ColumnSchemaInterface
public function smallInteger(int $length = null): ColumnInterface
{
return ColumnBuilder::smallint($length);
}
Expand All @@ -328,23 +328,23 @@ public function smallInteger(int $length = null): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::string()} instead. Will be removed in 2.0.0.
*/
public function string(int $length = null): ColumnSchemaInterface
public function string(int $length = null): ColumnInterface
{
return ColumnBuilder::string($length);
}

/**
* Creates a text column.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::text()} instead. Will be removed in 2.0.0.
*/
public function text(): ColumnSchemaInterface
public function text(): ColumnInterface
{
return ColumnBuilder::text();
}
Expand All @@ -357,11 +357,11 @@ public function text(): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::time()} instead. Will be removed in 2.0.0.
*/
public function time(int $precision = null): ColumnSchemaInterface
public function time(int $precision = null): ColumnInterface
{
return ColumnBuilder::time($precision);
}
Expand All @@ -374,11 +374,11 @@ public function time(int $precision = null): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::timestamp()} instead. Will be removed in 2.0.0.
*/
public function timestamp(int $precision = null): ColumnSchemaInterface
public function timestamp(int $precision = null): ColumnInterface
{
return ColumnBuilder::timestamp($precision);
}
Expand All @@ -390,11 +390,11 @@ public function timestamp(int $precision = null): ColumnSchemaInterface
*
* This parameter will be ignored if not supported by the DBMS.
*
* @return ColumnSchemaInterface The column instance which can be further customized.
* @return ColumnInterface The column instance which can be further customized.
*
* @deprecated Use {@see ColumnBuilder::tinyint()} instead. Will be removed in 2.0.0.
*/
public function tinyInteger(int $length = null): ColumnSchemaInterface
public function tinyInteger(int $length = null): ColumnInterface
{
return ColumnBuilder::tinyint($length);
}
Expand Down
Loading