2021-05-12 03:15:27 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Flarum.
|
|
|
|
*
|
|
|
|
* For detailed copyright and license information, please view the
|
|
|
|
* LICENSE file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
use Illuminate\Database\Schema\Builder;
|
|
|
|
|
|
|
|
return [
|
|
|
|
'up' => function (Builder $schema) {
|
|
|
|
$db = $schema->getConnection();
|
|
|
|
|
|
|
|
$db->table('group_permission')
|
2021-06-24 00:13:31 +08:00
|
|
|
->where('permission', 'LIKE', '%viewDiscussions')
|
2021-05-12 03:15:27 +08:00
|
|
|
->update(['permission' => $db->raw("REPLACE(permission, 'viewDiscussions', 'viewForum')")]);
|
|
|
|
|
|
|
|
$db->table('group_permission')
|
2021-06-26 14:19:27 +08:00
|
|
|
->where('permission', 'viewUserList')
|
|
|
|
->update(['permission' => 'searchUsers']);
|
2021-05-12 03:15:27 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'down' => function (Builder $schema) {
|
|
|
|
$db = $schema->getConnection();
|
|
|
|
|
|
|
|
$db->table('group_permission')
|
2021-06-24 00:13:31 +08:00
|
|
|
->where('permission', 'LIKE', '%viewForum')
|
2021-05-12 03:15:27 +08:00
|
|
|
->update(['permission' => $db->raw("REPLACE(permission, 'viewForum', 'viewDiscussions')")]);
|
|
|
|
|
|
|
|
$db->table('group_permission')
|
2021-06-26 14:19:27 +08:00
|
|
|
->where('permission', 'searchUsers')
|
|
|
|
->update(['permission' => 'viewUserList']);
|
2021-05-12 03:15:27 +08:00
|
|
|
}
|
|
|
|
];
|