Ah - if that works, that would be great. I'm new to Cake, and was
leery of just diving in and doing things to the database behind Cake's
back, as I've burnt myself in the past doing that to/with other
Frameworks. :)
Apart from that, I'm amazed how brilliant CakePHP2 is, and the more I
dig in, the
my guess:
cake doesnt support uuids for those things on "initialize"
but you could probably change the field manually to uuid afterwards
then it should work again
On 24 Okt., 09:59, André Fischer wrote:
> I created a database that uses UUIDs exclusively for all id fields.
> When I use cake i18n
I created a database that uses UUIDs exclusively for all id fields.
When I use cake i18n to initialise the table in the database to make
various models translatable, it creates an id fiend as INT instead of
CHAR(36), which breaks the translation behaviour. Am I doing something
wrong, or is this a b
Just wondering what fields you should user UUID for?
User id -> yes
but what about HABTM tables? and hasMany
id -> would you make this a UUID
post_id -> is the post created usinga UUID
tag_id -> and the tag? 1,2,3,4 ID or xxx-xx--xxx
Dave
--~--~-~--~~~---~--~--
I thought a behavior to insert UUID's would be better suited for this
over the MySQL triggers I was using so I through one together. Here a
link for anyone thats interested:
http://bin.cakephp.org/view/109738435
I am working on posting the behavior to the bakery as well.
Cheers,
Billy
--~--~-
I'd create a behavior. Of course models shouldn't access components,
so the logic from the component should be transferred to the behavior
itself. Something like this: http://pastebin.sk/en/1752/ (not tested,
just quickly written)
Cheers
grigri
On 30 May, 22:53, Langdon Stevenson <[EMAIL PROTECT
Interesting solution. I have been generating UUIDs in PHP for one of my
projects as my ISP only offers MySQL 4.x.
Regards,
Langdon
Divagater wrote:
> I use database triggers to handle writing UUID's for all of my id's.
> This is not a PHP solution and may or may not be appropriate for
> scala
I use database triggers to handle writing UUID's for all of my id's.
This is not a PHP solution and may or may not be appropriate for
scalability across a wide range of databases. In MySQL a trigger to to
add a UUID as the id of a particular table would look like this:
CREATE TRIGGER `posts_id` B
Please if you have any working code snippet showing me how to
integrate Daniel Hofstetter (http://cakebaker.42dh.com) Uuid
component into my model, so the autoincrement id is not necesary in
the future...
Thanks !
--~--~-~--~~~---~--~~
You received this message