mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 00:03:37 +08:00
reordered migrations
This commit is contained in:
parent
3737ce8146
commit
58ab6052ad
|
@ -16,12 +16,15 @@ return [
|
|||
'up' => function (Builder $schema) {
|
||||
$schema->table('users', function (Blueprint $table) {
|
||||
$table->boolean('disclose_online')->default(false);
|
||||
$table->string('locale')->nullable();
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('disclose_online');
|
||||
$table->dropColumn('locale');
|
||||
});
|
||||
}
|
||||
];
|
|
@ -27,6 +27,11 @@ return [
|
|||
->where('id', $user->id)
|
||||
->update(['disclose_online' => (bool) $value]);
|
||||
}
|
||||
if ($key === 'locale') {
|
||||
$db->table('users')
|
||||
->where('id', $user->id)
|
||||
->update(['locale' => $value]);
|
||||
}
|
||||
if (preg_match('/^notify_(?<type>[^_]+)_(?<channel>.*)$/', $key, $matches)) {
|
||||
$db->table('notification_preferences')
|
||||
->insert([
|
Loading…
Reference in New Issue
Block a user