This commit is contained in:
James Cole 2019-02-11 17:07:07 +01:00
parent b6ea2f1c64
commit ed08d299de
2 changed files with 52 additions and 1 deletions

View File

@ -45,9 +45,17 @@ class ChangesForV4711 extends Migration
*/
public function up(): void
{
/**
* In 4.7.11, I changed the date field to a "datetimetz" field. This wreaks havoc
* because apparently MySQL is not actually capable of handling multiple time zones,
* only having a server wide time zone setting. Actual database schemes like Postgres
* handle this just fine but the combination is unpredictable. So we go back to
* datetime (without a time zone) for all database engines because MySQL refuses to play
* nice.
*/
Schema::table(
'transaction_journals', function (Blueprint $table) {
$table->dateTimeTz('date')->change();
$table->dateTime('date')->change();
}
);

View File

@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class ChangesForV4712
*/
class ChangesForV4712 extends Migration
{
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
//
}
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
/**
* In 4.7.11, I changed the date field to a "datetimetz" field. This wreaks havoc
* because apparently MySQL is not actually capable of handling multiple time zones,
* only having a server wide time zone setting. Actual database schemes like Postgres
* handle this just fine but the combination is unpredictable. So we go back to
* datetime (without a time zone) for all database engines because MySQL refuses to play
* nice.
*/
Schema::table(
'transaction_journals', function (Blueprint $table) {
$table->dateTime('date')->change();
}
);
}
}