mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-25 01:51:00 +03:00
11 lines
373 B
SQL
11 lines
373 B
SQL
-- WARNING! Usage of this generation method is NOT recommended
|
|
|
|
DELIMITER //
|
|
CREATE TRIGGER setUUID BEFORE INSERT ON users
|
|
FOR EACH ROW BEGIN
|
|
IF NEW.uuid IS NULL THEN
|
|
SET @md5 = MD5(CONCAT("OfflinePlayer:", NEW.username));
|
|
SET NEW.uuid = CONCAT_WS('-', LEFT(@md5, 8), MID(@md5, 9, 4), MID(@md5, 13, 4), MID(@md5, 17, 4), RIGHT(@md5, 12));
|
|
END IF;
|
|
END; //
|
|
DELIMITER ;
|