diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index eeaaec1b6..63b069199 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -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), diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index 4ced3b61b..c4115b2e3 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -455,7 +455,7 @@ class ModelWriteTest extends BaseModelTest { )); $result = $TestModel->findById(1); - debug($result); + $this->assertEquals($result['Syfile']['item_count'], 1); $TestModel2->id = 1;