Include updating of scoped tag permissions

Addresses https://github.com/flarum/core/issues/2924

The rename `viewDiscussions` migration introduced for Flarum 1.0 does not take tag scoped permissions into account
032db2c146/migrations/2021_05_10_000000_rename_permissions.php (L17)

This adds a new migration to additionally rename `tagX.viewDiscussions` to `tagX.viewForum`

Tested locally on an upgrade from core `beta.16` to `1.0.3`
This commit is contained in:
Ian Morland 2021-06-23 17:13:31 +01:00 committed by Daniël Klabbers
parent 032db2c146
commit 6e05406f45

View File

@ -14,7 +14,7 @@ return [
$db = $schema->getConnection();
$db->table('group_permission')
->where('permission', 'LIKE', 'viewDiscussions')
->where('permission', 'LIKE', '%viewDiscussions')
->update(['permission' => $db->raw("REPLACE(permission, 'viewDiscussions', 'viewForum')")]);
$db->table('group_permission')
@ -26,7 +26,7 @@ return [
$db = $schema->getConnection();
$db->table('group_permission')
->where('permission', 'LIKE', 'viewForum')
->where('permission', 'LIKE', '%viewForum')
->update(['permission' => $db->raw("REPLACE(permission, 'viewForum', 'viewDiscussions')")]);
$db->table('group_permission')