Skip to content

Instantly share code, notes, and snippets.

@pumatertion
Created May 12, 2013 14:12
Show Gist options
  • Save pumatertion/5563713 to your computer and use it in GitHub Desktop.
Save pumatertion/5563713 to your computer and use it in GitHub Desktop.
UUID usage in TYPO3 Core
I would like to enable uuid support in typo3.
I would like also backport the uuid generation of flow wich has a php script to generate uuid.
This could be used in Generic Backend on insert to generate the uuid.
But what about the backend? there is no extbase persistence.
So what about switching the uid fields from integer to varchar.
Removing auto increment and put a trigger on any typo3 tables like this one:
DELIMITER //
CREATE TRIGGER `tt_content_uuid` BEFORE INSERT ON `tt_content`
FOR EACH ROW begin
IF ASCII(NEW.uid) = 0 THEN
SET NEW.uid = UUID();
END IF;
end//
DELIMITER ;
so in the backend we dont have to generate any uuid. its done on insert.
in extbase, we dont need to persist an empty entity to get a autoincrement uid.
what do you think?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment