From ed08d299de91932f90f8616321459e70456fa0da Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 11 Feb 2019 17:07:07 +0100 Subject: [PATCH] Fix for #2017 --- .../2019_02_05_055516_changes_for_v4711.php | 10 ++++- .../2019_02_11_170529_changes_for_v4712.php | 43 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2019_02_11_170529_changes_for_v4712.php diff --git a/database/migrations/2019_02_05_055516_changes_for_v4711.php b/database/migrations/2019_02_05_055516_changes_for_v4711.php index e89902f9e8..c05b293ac2 100644 --- a/database/migrations/2019_02_05_055516_changes_for_v4711.php +++ b/database/migrations/2019_02_05_055516_changes_for_v4711.php @@ -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(); } ); diff --git a/database/migrations/2019_02_11_170529_changes_for_v4712.php b/database/migrations/2019_02_11_170529_changes_for_v4712.php new file mode 100644 index 0000000000..f0a9276cd2 --- /dev/null +++ b/database/migrations/2019_02_11_170529_changes_for_v4712.php @@ -0,0 +1,43 @@ +dateTime('date')->change(); + } + ); + } +}