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