Skip to content

Commit 881d9a7

Browse files
author
Paweł Brzozowski
committed
3.3.0
1 parent 41ee8b9 commit 881d9a7

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ Add the package to your composer.json:
1515

1616
{
1717
"require": {
18-
"bizley/migration": "^3.2"
18+
"bizley/migration": "^3.3"
1919
}
2020
}
2121

22-
and run `composer update` or alternatively run `composer require bizley/migration:^3.2`
22+
and run `composer update` or alternatively run `composer require bizley/migration:^3.3`
2323

2424
## Installation for PHP < 7.1
2525

2626
Add the package to your composer.json:
2727

2828
{
2929
"require": {
30-
"bizley/migration": "^2.5"
30+
"bizley/migration": "^2.6"
3131
}
3232
}
3333

34-
and run `composer update` or alternatively run `composer require bizley/migration:^2.5`
34+
and run `composer update` or alternatively run `composer require bizley/migration:^2.6`
3535

3636
## Configuration
3737

@@ -151,6 +151,9 @@ default `yii\db\Migration` methods can be recognised (with the exception of `exe
151151
`dropCommentFromTable()` methods). Changes made to table's data (like `insert()`, `upsert()`, `delete()`, `truncate()`,
152152
etc.) are not tracked.
153153

154+
Updating migrations process requires for methods `createTable()`, `addColumn()`, and `alterColumn()` to provide changes
155+
in columns definition in form of an instance of `yii\db\ColumnSchemaBuilder` (like `$this->string()` instead of `'varchar(255)'`).
156+
154157
## Tests
155158

156159
Tests for MySQL, PostgreSQL, and SQLite are provided. Database configuration is stored in `tests/config.php` (you can override it by

src/table/TableChange.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getValue()
5757
'isUnique' => $schema['isUnique'] ?? null,
5858
'isPrimaryKey' => $schema['isPrimaryKey'] ?? null,
5959
'check' => $schema['check'] ?? null,
60-
'default' => $schema['default'],
60+
'default' => $schema['default'] ?? null,
6161
'append' => $schema['append'] ?? null,
6262
'isUnsigned' => $schema['isUnsigned'] ?? null,
6363
'comment' => !empty($schema['comment']) ? $schema['comment'] : null,
@@ -82,7 +82,7 @@ public function getValue()
8282
'isUnique' => $this->data[1]['isUnique'] ?? null,
8383
'isPrimaryKey' => $this->data[1]['isPrimaryKey'] ?? null,
8484
'check' => $this->data[1]['check'] ?? null,
85-
'default' => $this->data[1]['default'],
85+
'default' => $this->data[1]['default'] ?? null,
8686
'append' => $this->data[1]['append'] ?? null,
8787
'isUnsigned' => $this->data[1]['isUnsigned'] ?? null,
8888
'comment' => !empty($this->data[1]['comment']) ? $this->data[1]['comment'] : null,

src/table/TableColumnJson.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TableColumnJson extends TableColumn
1616
{
1717
/**
1818
* Checks if default value is JSONed array. If so it's decoded.
19-
* @since 3.2.1
19+
* @since 3.3.0
2020
*/
2121
public function init(): void
2222
{

0 commit comments

Comments
 (0)