[BUGFIX] Roles are not synchronized after database migrate
The roles are not synchronized from the Policy.yaml files to the
database after the database migration, but only after rebuilding
the cache. This causes problems in the setup package where the
database migration is run and the next step fails in reading the
roles from the database.
By adding a signal to the doctrine migration command we can run
the synchronization after database migration so the roles in the
database will always be up to date after migration.
This change makes the initializeRolesFromPolicy method public
which does not cause issues as the method won't perform any
actions if the rolesFromPolicyUpToDate flag in the cache is set.
Releases: master, 2.0