-- Create Trigger
USE mm_user_db;

DELIMITER $$
CREATE TRIGGER accountuid_match
BEFORE INSERT ON mm_user_db.user_tb
FOR EACH ROW
BEGIN
    SET NEW.AccountUID = (SELECT AUTO_INCREMENT
                          FROM information_schema.TABLES
                          WHERE TABLE_SCHEMA = 'mm_user_db'
                          AND TABLE_NAME = 'user_tb');
END$$
DELIMITER ;


-- Remove Trigger
USE mm_user_db;
DROP TRIGGER IF EXISTS accountuid_match;