Skip to content

Commit

Permalink
Merge pull request coollabsio#3367 from peaklabs-dev/default-timezone
Browse files Browse the repository at this point in the history
Fix: Set a default server timezone
  • Loading branch information
andrasbacsai authored Sep 9, 2024
2 parents 84093af + 59c7f2c commit 9e6486f
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;

class UpdateServerSettingsDefaultTimezone extends Migration
{
public function up()
{
Schema::table('server_settings', function (Blueprint $table) {
$table->string('server_timezone')->default('UTC')->change();
});

DB::table('server_settings')
->whereNull('server_timezone')
->orWhere('server_timezone', '')
->update(['server_timezone' => 'UTC']);
}

public function down()
{
Schema::table('server_settings', function (Blueprint $table) {
$table->string('server_timezone')->default('')->change();
});
}
}

0 comments on commit 9e6486f

Please sign in to comment.