Skip to content

Commit

Permalink
Return length 36 for uuid columns in Postgres.describe()
Browse files Browse the repository at this point in the history
When describing a Postgres native "uuid" column, the length 36 should be
returned so that Model.save() will be able to correctly set $isUUID as
"true" on that column.

Fixes #2467
  • Loading branch information
starlocke committed Jan 11, 2012
1 parent 32cb416 commit cf8c1cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Cake/Model/Datasource/Database/Postgres.php
Expand Up @@ -206,6 +206,8 @@ public function describe($model) {
if ($c->type == 'character varying') {
$length = null;
$type = 'text';
} else if ($c->type == 'uuid') {
$length = 36;
} else {
$length = intval($c->oct_length);
}
Expand Down

0 comments on commit cf8c1cd

Please sign in to comment.