# Uuid as id on records

**URL:** https://discourse.cakephp.org/t/uuid-as-id-on-records/8251
**Category:** Need Help
**Created:** [August 20, 2020, 9:51pm UTC](https://discourse.cakephp.org/t/uuid-as-id-on-records/8251 "2020-08-20T21:51:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![justinkbug](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@justinkbug](https://discourse.cakephp.org/u/justinkbug)
#### Post date: [August 20, 2020, 9:51pm UTC](https://discourse.cakephp.org/t/uuid-as-id-on-records/8251/1 "2020-08-20T21:51:20Z")

</div>

I’m in the process of upgrading a CakePHP2 app to CakePHP4. In version 2 I had several database tables that was using varchar(36) as the id. CakePHP2 would automatically generate a uuid for those fields. That doesn’t appear to be working in version 4 for me. I can’t seem to find any documentation on it. Does anyone know if that’s still there in version 4 and where the documentation might be?

---

<div class="post-metadata">

### Author: ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)
#### Post date: [August 21, 2020, 2:47pm UTC](https://discourse.cakephp.org/t/uuid-as-id-on-records/8251/2 "2020-08-21T14:47:25Z")

</div>

Here are metions of UUIDs that related to the feature you want. None seem to go straight to the heart, but clearly the feature still exists

[https://book.cakephp.org/4/en/intro/conventions.html#database-conventions](https://book.cakephp.org/4/en/intro/conventions.html#database-conventions)

[https://book.cakephp.org/4/en/orm/database-basics.html#data-types](https://book.cakephp.org/4/en/orm/database-basics.html#data-types)

[https://book.cakephp.org/4/en/orm/saving-data.html#creating-with-an-existing-primary-key](https://book.cakephp.org/4/en/orm/saving-data.html#creating-with-an-existing-primary-key)

---

<div class="post-metadata">

### Author: ![justinkbug](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@justinkbug](https://discourse.cakephp.org/u/justinkbug)
#### Post date: [August 21, 2020, 4:01pm UTC](https://discourse.cakephp.org/t/uuid-as-id-on-records/8251/3 "2020-08-21T16:01:46Z")

</div>

Thanks for the references. So once I changed it from varchar(36) to char(36), it started working.
