From 9ccc951fce9c4b634ca245a955d1e36e478b7d55 Mon Sep 17 00:00:00 2001 From: Shane Archer Date: Fri, 31 Jul 2015 11:13:20 -0700 Subject: [PATCH] Fixing timezone offset to work off of the server's configured time zone. --- lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | 6 ------ .../DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php | 6 +++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php index 89f71208e69..aaf6eea617d 100644 --- a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php @@ -171,12 +171,6 @@ public function listTableColumns($table, $database = null) $sql = $this->_platform->getListTableColumnsSQL($table, $database); $tableColumns = $this->_conn->fetchAll($sql); - // very temporary for examing result of test under Travis - if ($table == 'test_datetimetz_default_table') { - var_dump($sql); - var_dump($tableColumns); - } - return $this->_getPortableTableColumnList($table, $database, $tableColumns); } diff --git a/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php b/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php index 4af44f74001..c97590fc0be 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php @@ -457,7 +457,11 @@ public function testDatetimeDefaultTimestamp() */ public function testDatetimeTzDefaultTimestamp() { - $testTimestamp = '2014-08-29 18:01:01.370568-07'; + // must determine server time zone for proper comparison + $serverTime = $this->_conn->fetchAssoc('SELECT CURRENT_TIMESTAMP AS timestamp_with_tz'); + $timeZoneOffset = substr($serverTime['timestamp_with_tz'], -3); + + $testTimestamp = '2014-08-29 18:01:01.370568' . $timeZoneOffset; $table = new \Doctrine\DBAL\Schema\Table('test_datetimetz_default_table');