mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Preventing zero length of fields using prostgres
This commit is contained in:
parent
2eb0392b8a
commit
25c213e976
2 changed files with 4 additions and 1 deletions
|
@ -211,6 +211,9 @@ class DboPostgres extends DboSource {
|
||||||
} else {
|
} else {
|
||||||
$length = $this->length($c->type);
|
$length = $this->length($c->type);
|
||||||
}
|
}
|
||||||
|
if (empty($length)) {
|
||||||
|
$length = null;
|
||||||
|
}
|
||||||
$fields[$c->name] = array(
|
$fields[$c->name] = array(
|
||||||
'type' => $this->column($type),
|
'type' => $this->column($type),
|
||||||
'null' => ($c->null == 'NO' ? false : true),
|
'null' => ($c->null == 'NO' ? false : true),
|
||||||
|
|
|
@ -455,7 +455,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
));
|
));
|
||||||
|
|
||||||
$result = $TestModel->findById(1);
|
$result = $TestModel->findById(1);
|
||||||
debug($result);
|
|
||||||
$this->assertEquals($result['Syfile']['item_count'], 1);
|
$this->assertEquals($result['Syfile']['item_count'], 1);
|
||||||
|
|
||||||
$TestModel2->id = 1;
|
$TestModel2->id = 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue