From 1efc90034650c5f886286d575c1ec4bf931c7735 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sun, 7 Apr 2024 17:43:52 +0700 Subject: [PATCH] Update UPGRADE.md by @vjik --- UPGRADE.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 45f0cd279..c7c4accb1 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,14 +1,18 @@ # Upgrading Instructions for Yii Database -This file contains the upgrade notes for the Yii Database. -These notes highlight changes that could break your application when you upgrade it from one version to another. -Even though we try to ensure backwards compatibility (BC) as much as possible, sometimes -it isn't possible or very complicated to avoid it and still create a good solution to -a problem. While upgrade to Yii 3.0 might require substantial changes to both your application and extensions, -the changes are bearable and require "refactoring", not "rewrite". -All the "Yes, it is" cool stuff, and Yii soul is still in place. - -Changes summary: - -* `Yiisoft\Db\Connection::$charset` has been removed. All supported PDO classes allow you to specify the connection - charset in the DSN. +The following upgrading instructions are cumulative. That is, if you want to upgrade from version A to version C and +there is version B between A and C, you need to following the instructions for both A and B. + +## Upgrade from 1.x to 2.x + +Add `ColumnInterface` support and change type of parameter `$type` from `string` to `ColumnInterface|string` +in `addColumn()` method of your classes that implement the following interfaces: + +- `Yiisoft\Db\Command\CommandInterface`; +- `Yiisoft\Db\QueryBuilder\DDLQueryBuilderInterface`; + +… or inherit from the following classes: + +- `Yiisoft\Db\Command\AbstractCommand`; +- `Yiisoft\Db\QueryBuilder\AbstractDDLQueryBuilder`; +- `Yiisoft\Db\QueryBuilder\AbstractQueryBuilder`.