diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 6a5b5a5b9..a0c0eb3f5 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -600,7 +600,7 @@ class DboPostgres extends DboSource { } if (isset($default)) { - $colList[] = 'ALTER COLUMN '. $fieldName .' SET DEFAULT ' . $default; + $colList[] = 'ALTER COLUMN '. $fieldName .' SET DEFAULT ' . $this->value($default, $field); } else { $colList[] = 'ALTER COLUMN '. $fieldName .' DROP DEFAULT'; } diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 38f3a28af..a2a313dd1 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -655,7 +655,7 @@ class DboPostgresTest extends CakeTestCase { 'alter_posts' => array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'author_id' => array('type' => 'integer', 'null' => true), - 'title' => array('type' => 'string', 'null' => false), + 'title' => array('type' => 'string', 'null' => false, 'default' => 'my title'), 'body' => array('type' => 'string', 'length' => 500), 'status' => array('type' => 'integer', 'length' => 3, 'default' => 1), 'created' => array('type' => 'datetime'),