You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: framework/UPGRADE.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,29 @@ Upgrade from Yii 2.0.50
107
107
108
108
* Correcting the behavior for `JSON` column type in `MariaDb`.
109
109
110
+
Columns that are created as `JSON` now automatically add a Check constraint for `json_valid` to the according column.
111
+
If Yii2 detects that a column has this `json_valid` constraint, data passed into or fetched from it is automatically serialized/deserialized.
112
+
113
+
While this does affect migrations created before the update when running them afterwards, it doesn't retroactively change tables created through migrations before the update!
114
+
This means that running a migration script that invokes `yii\db\Migration::json()` for a MariaDb database will create a different database schema after the update than it did before.
115
+
116
+
To preserve the old behavior, migrations need to be changed to instead create a `LONGTEXT` column without a constraint:
117
+
118
+
```php
119
+
<?php
120
+
class m251103_091000_example_migration extends Migration {
0 commit comments