Preventing zero length of fields using prostgres

This commit is contained in:
José Lorenzo Rodríguez 2010-10-25 20:25:07 -04:30
parent 2eb0392b8a
commit 25c213e976
2 changed files with 4 additions and 1 deletions

View file

@ -211,6 +211,9 @@ class DboPostgres extends DboSource {
} else {
$length = $this->length($c->type);
}
if (empty($length)) {
$length = null;
}
$fields[$c->name] = array(
'type' => $this->column($type),
'null' => ($c->null == 'NO' ? false : true),

View file

@ -455,7 +455,7 @@ class ModelWriteTest extends BaseModelTest {
));
$result = $TestModel->findById(1);
debug($result);
$this->assertEquals($result['Syfile']['item_count'], 1);
$TestModel2->id = 1;