Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

2.0 2467 #401

Merged
merged 1 commit into from

2 participants

@starlocke

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

@starlocke starlocke 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
cf8c1cd
@lorenzo
Owner

Thanks, this is a great idea :)

@lorenzo lorenzo merged commit c168677 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 11, 2012
  1. @starlocke

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

    starlocke authored
    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
This page is out of date. Refresh to see the latest.
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);
}
Something went wrong with that request. Please try again.