I have a users
table in my database and I want it to set UUID for every new user record.
DELIMITER ;;
CREATE TRIGGER user_uuid
BEFORE INSERT ON users
FOR EACH ROW
BEGIN
IF new.uuid IS NULL THEN
SET new.uuid = uuid();
END IF;
END
;;
I used the above code and I checked from phpMyAdmin if it's set or not. It seems set but not creating UUID value on uuid columns when a user registered.
Can you see what's wrong with my code as it seems okay from here. Thank you.
I'm storing UUID values on CHAR32
data type, if it's needed.