Browse Source

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
Victor Yap 14 years ago
parent
commit
cf8c1cd93b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lib/Cake/Model/Datasource/Database/Postgres.php

+ 2 - 0
lib/Cake/Model/Datasource/Database/Postgres.php

@@ -206,6 +206,8 @@ class Postgres extends DboSource {
 					if ($c->type == 'character varying') {
 						$length = null;
 						$type = 'text';
+					} else if ($c->type == 'uuid') {
+						$length = 36;
 					} else {
 						$length = intval($c->oct_length);
 					}