Permalink
Browse files

Return length 36 for uuid columns in Postgres.describe()

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...
1 parent 32cb416 commit cf8c1cd93b33a5131e01df34dc4a419d4d99e0f2 @starlocke starlocke committed Jan 11, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/Cake/Model/Datasource/Database/Postgres.php
View
2 lib/Cake/Model/Datasource/Database/Postgres.php
@@ -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);
}

0 comments on commit cf8c1cd

Please sign in to comment.