#6412: Automatic uuid generation doesn't work on Sqlite because datasource always returns primary key length of 11 ----------------------------+----------------------------------------------- Reporter: txberiu | Type: Bug Status: new | Priority: High Milestone: 1.2.x.x | Component: Model Version: 1.2 Final | Severity: Normal Keywords: sqlite uuid | Php_version: n/a Cake_version: | ----------------------------+----------------------------------------------- = Problem = I am using Sqlite and tried to use uuids by defining my id column as CHAR(36) PRIMARY KEY. However, no uuids were being generated.
= Investigation = A {{{debug($this->MyModel->schema(true));}}} in the appropriate model revealed that the length of the id was always reported as 11, instead of 36. It looks like the length of the primary key is hard-coded to 11 in {{{cake/cake/libs/model/datasources/dbo_sqlite.php}}} (thank you markstory for pointing that out). = Fix = Copy/pasting the correct length definition, as used just above in the file, fixes the length value and enables proper uuid generation. -- Ticket URL: <https://trac.cakephp.org/ticket/6412> CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/> Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tickets cakephp" group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---