Hi,
I'm using PostgreSQL and I have the follow table in database:
CREATE TABLE tabla
(
"TablaId" uuid NOT NULL DEFAULT uuid_generate_v4(),
CONSTRAINT tabla_pkey PRIMARY KEY ("TablaId")
);
And Model:
class Tabla extends \Phalcon\Mvc\Model {
private $TablaId;
//getters and setters
function getTablaId() {
return $this->TablaId;
}
function setTablaId($TablaId) {
$this->TablaId = $TablaId;
}
}
When I save the model like:
$data = [];
$obj = new Tabla();
$obj->save($data);
The result is OK, the object save in database but when I make a print_r($obj); I can't see the uuid autogenerated value.
¿How can I get it? It works with autoincrement column in mysql and serial in postgresql, but with a uuid autogenerated primary key not work in postgresql
Thanks