Skip to content

Commit

Permalink
Add Add lines to CHANGELOG.md, update UPGRADE.md, update PHPdoc [skip…
Browse files Browse the repository at this point in the history
… ci]
  • Loading branch information
Tigrov committed Aug 9, 2024
1 parent dfb8036 commit da871f8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
- Chg #847: Remove `SchemaInterface::getRawTableName()` and `AbstractSchema::getRawTableName()` methods (@Tigrov)
- Enh #852: Add method chaining for column classes (@Tigrov)
- Enh #855: Add array and JSON overlaps conditions (@Tigrov)
- Enh #860 Add `bit` abstract type (@Tigrov)
- Enh #860: Add `bit` abstract type (@Tigrov)
- Enh #862: Refactor PHP type of `SchemaInterface` instances (@Tigrov)

## 1.3.0 March 21, 2024

Expand Down
17 changes: 16 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,22 @@ The interface and the abstract implementation `AbstractColumnSchema` were moved
and the following changes were made:

- `getName()` method can return `string` or `null`;
- `getPhpType()` method must return `string` PHP type of the column which used for generating related model properties;
- `name(string|null $name)` method is added;
- constructor of `AbstractColumnSchema` class is changed to `__construct(string $type, string|null $phpType = null)`;
- added method chaining.

### New classes with constants

- `Yiisoft\Db\Constant\PhpType` with PHP types constants;
- `Yiisoft\Db\Constant\GettypeResult` with `gettype()` function results constants.

### New classes for table columns

Each table column has its own class in the `Yiisoft\Db\Schema\Column` namespace according to the data type:

- `BooleanColumnSchema` for columns with boolean type;
- `BitColumnSchema` for columns with bit type;
- `IntegerColumnSchema` for columns with integer type (tinyint, smallint, integer, bigint);
- `BigIntColumnSchema` for columns with integer type with range outside `PHP_INT_MIN` and `PHP_INT_MAX`;
- `DoubleColumnSchema` for columns with fractional number type (float, double, decimal, money);
Expand All @@ -96,6 +103,7 @@ Each table column has its own class in the `Yiisoft\Db\Schema\Column` namespace
- `AbstractSchema::normalizeRowKeyCase()`
- `Quoter::unquoteParts()`
- `AbstractPdoCommand::logQuery()`
- `ColumnSchemaInterface::phpType()`

### Remove deprecated parameters

Expand All @@ -105,9 +113,16 @@ Each table column has its own class in the `Yiisoft\Db\Schema\Column` namespace
- `$rawSql` from `AbstractCommand::internalExecute()` method
- `$rawSql` from `AbstractPdoCommand::internalExecute()` method

### Remove deprecated constants
### Remove constants

- `SchemaInterface::TYPE_JSONB`
- `SchemaInterface::PHP_TYPE_INTEGER`
- `SchemaInterface::PHP_TYPE_STRING`
- `SchemaInterface::PHP_TYPE_BOOLEAN`
- `SchemaInterface::PHP_TYPE_DOUBLE`
- `SchemaInterface::PHP_TYPE_RESOURCE`
- `SchemaInterface::PHP_TYPE_ARRAY`
- `SchemaInterface::PHP_TYPE_NULL`

### Other changes

Expand Down
2 changes: 1 addition & 1 deletion src/Constant/PhpType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* Defines the available PHP types.
* Used to generate properties of Active Record model or other user defined models.
* Used to generate properties of a related model class.
*
* @see ColumnSchemaInterface::getPhpType()
* @see https://www.php.net/manual/en/language.types.type-system.php
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Column/ColumnSchemaInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function getName(): string|null;
public function getPrecision(): int|null;

/**
* Returns the PHP type of the column. Used for generating Active Record model properties.
* Returns the PHP type of the column. Used for generating properties of a related model class.
*
* @return string The PHP type of the column.
*
Expand Down

0 comments on commit da871f8

Please sign in to comment.