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',