Using value() in default value generation with CakeSchema and DboPostgres

This commit is contained in:
José Lorenzo Rodríguez 2010-03-29 23:50:40 -04:30
parent 13996e94c7
commit bbf96567eb
2 changed files with 2 additions and 2 deletions

View file

@ -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';
}

View file

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