mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 07:33:36 +08:00
Add migration to add 'fa fa-' to group icons (#1597)
* Add migration to add 'fa fa-' (FA v4 shim) to group icons * StyleCI * Change prefix to `fas fa-`
This commit is contained in:
parent
a900bf5ffa
commit
5f785c9473
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Flarum.
|
||||||
|
*
|
||||||
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||||
|
*
|
||||||
|
* For the full 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) {
|
||||||
|
$groups = $schema->getConnection()->table('groups')
|
||||||
|
->where('icon', '<>', '')
|
||||||
|
->where('icon', 'NOT LIKE', '%fa-%')
|
||||||
|
->select('id', 'icon')
|
||||||
|
->cursor();
|
||||||
|
|
||||||
|
foreach ($groups as $group) {
|
||||||
|
$schema->getConnection()->table('groups')
|
||||||
|
->where('id', $group->id)
|
||||||
|
->update([
|
||||||
|
'icon' => 'fas fa-'.$group->icon
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'down' => function (Builder $schema) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
];
|
Loading…
Reference in New Issue
Block a user