Closed RobinDev closed 7 months ago
Just switching the deprecated array type to json - cf Upgrade Guide
I am targeting this branch, because change cannot be done without a BC-break.
### Changed - roles mapped type (orm) from `array` to `json`
A migration must be done, example :
<?php declare(strict_types=1); namespace DoctrineMigrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; final class Version1709056840 extends AbstractMigration { public function up(Schema $schema): void { $rows = $this->connection->fetchAllAssociative('SELECT id,roles FROM user'); /** @var array{'id': scalar, 'roles': string}[] $rows */ foreach ($rows as $row) { $id = $row['id']; $roles = json_encode(unserialize($row['roles'])); $this->connection->executeQuery('UPDATE user SET roles = :roles WHERE id = :id', ['roles' => $roles, 'id' => $id]); } } }
Compatibility with doctrine dbal 4
Just switching the deprecated array type to json - cf Upgrade Guide
I am targeting this branch, because change cannot be done without a BC-break.
Changelog
Upgrade
A migration must be done, example :