Unverified Commit 9d4f3f8c authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Ensure that database timezone matches IRIS time zone

All travelynx and IRIS timestamps are Europe/Berlin. And the DateTime objects
know that they are Europe/Berlin. However, when inserting into a timestamp with
time zone column, Mojo::Pg or one of the backend DBI/DBD libraries does not
respect the time zone. So, UTC+1 or UTC+2 timestamps are treated as UTC+0,
resulting in major mayhem.
parent 564f2fb3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -369,6 +369,15 @@ sub startup {
			state $pg
			  = Mojo::Pg->new("postgresql://${user}\@${host}:${port}/${dbname}")
			  ->password($pw);

			$pg->on(
				connection => sub {
					my ( $pg, $dbh ) = @_;
					$dbh->do("set time zone 'Europe/Berlin'");
				}
			);

			return $pg;
		}
	);