Files
monica/database/migrations/2017_06_14_131803_remove_bern_timezone.php
T
Régis FreydandGitHub 29197090a7 Restructure where models are stored (#1476)
The idea is to clean the repository a little bit by moving models into their respective folders.
2018-06-14 20:49:12 -04:00

24 lines
458 B
PHP

<?php
use App\Models\User\User;
use Illuminate\Database\Migrations\Migration;
class RemoveBernTimezone extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$users = User::all();
foreach ($users as $user) {
if ($user->timezone == 'Europe/Bern') {
$user->timezone = 'Europe/Berlin';
$user->save();
}
}
}
}