From 74ba030e7cde79f208bacda04deeb366527b3429 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sat, 3 Sep 2011 18:34:11 -0430 Subject: [PATCH] More postgres tests passing again --- lib/Cake/Console/Command/SchemaShell.php | 6 ++++-- .../Test/Case/Model/Datasource/Database/PostgresTest.php | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Console/Command/SchemaShell.php b/lib/Cake/Console/Command/SchemaShell.php index aadcf93fb..1b7a9eb87 100644 --- a/lib/Cake/Console/Command/SchemaShell.php +++ b/lib/Cake/Console/Command/SchemaShell.php @@ -419,8 +419,10 @@ class SchemaShell extends Shell { return false; } $error = null; - if (!$db->execute($sql)) { - $error = $table . ': ' . $db->lastError(); + try { + $db->execute($sql); + } catch (PDOException $e) { + $error = $table . ': ' . $e->getMessage(); } $Schema->after(array($event => $table, 'errors' => $error)); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php index 15ce78560..06930677f 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php @@ -678,7 +678,6 @@ class DboPostgresTest extends CakeTestCase { )); $this->Dbo->rawQuery($this->Dbo->createSchema($schema1)); - $this->Dbo->rawQuery($this->Dbo->dropSchema($schema1)); $schema2 = new CakeSchema(array( 'name' => 'AlterTest2',