Skip to content

Instantly share code, notes, and snippets.

@gaelbillon
Created December 20, 2012 10:02
Show Gist options
  • Save gaelbillon/4344343 to your computer and use it in GitHub Desktop.
Save gaelbillon/4344343 to your computer and use it in GitHub Desktop.
MySQL ID -> UUID trigger
CREATE TRIGGER
newid
BEFORE INSERT ON
table_name
FOR EACH ROW
SET NEW.id = UUID()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment