Open rande opened 4 months ago
There is the error
In MappingException.php line 112:
The column type of attribute 'roles' on class 'Sonata\UserBundle\Tests\App\
Entity\User' could not be changed.
@VincentLanglet hopefully this is good to go!
The doc need to be updated too, in order to remove reference of BaseUser3 https://github.com/sonata-project/SonataUserBundle/blob/a6169f318ad30a46ced640fad58a686e695e86f0/docs/reference/installation.rst#doctrine-orm-configuration
We probably need to find a way to Migrate the User Data?
My current attempt is this Doctrine Migration file:
$result = $this->connection->executeQuery('SELECT id, roles FROM fos_user_user');
foreach ($result->fetchAllAssociative() as $item) {
$this->connection->update('fos_user_user', [
'roles' => json_encode(unserialize($item['roles']))
], [
'id' => $item['id']
]);
}
$this->addSql('ALTER TABLE fos_user_user CHANGE roles roles JSON NOT NULL');
@VincentLanglet @greg0ire how is the status for this MR?
And do we need an update Script for existing data?
@VincentLanglet @greg0ire how is the status for this MR?
And do we need an update Script for existing data?
See https://github.com/sonata-project/SonataUserBundle/pull/1685#issuecomment-2113465869
You can do it if you want this to be merged
@VincentLanglet the Doc update is one thing, should we try to something like my Update Script in a more automated way?
https://github.com/sonata-project/SonataUserBundle/pull/1685#issuecomment-2166019519
Or is the Dev alone with this? (i also don't know if my way is the correct one)
@VincentLanglet the Doc update is one thing, should we try to something like my Update Script in a more automated way?
Or is the Dev alone with this? (i also don't know if my way is the correct one)
We can document some helper/migrations about how to move from DBAL 3 to DBAL 4 but this cannot be included inside the SonataUserBundle code since we cannot be sure
Make the code compatible with DBAL 3 and 4 by swithing the type when the Mapping is loaded
I am targeting this branch, because because it introduces a non necessary BC break. For reference: https://github.com/sonata-project/SonataUserBundle/pull/1677
Changelog
To do