MySQL Trigger to generate a slug on before insert a new row
This week I needed to write a trigger for MySQL to generate automatically the slug from a string column whenever a new game is added. What this trigger does is to get the game name column and replace some characters to generate a proper slug. Watch out for the escaped characters that are removed after the trigger is created.