Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit cf8c1cd93b33a5131e01df34dc4a419d4d99e0f2 1 parent 32cb416
@starlocke starlocke authored
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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.