Uuid as id on records

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?

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/orm/database-basics.html#data-types

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

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

2 Likes