From cf8c1cd93b33a5131e01df34dc4a419d4d99e0f2 Mon Sep 17 00:00:00 2001 From: Victor Yap Date: Wed, 11 Jan 2012 17:12:42 -0500 Subject: [PATCH] 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 --- lib/Cake/Model/Datasource/Database/Postgres.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index 3e47f52f232..73b0cd2b9ae 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/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); }