DROP TRIGGER IF EXISTS `ImportScriptBackup_ai`;
COMMIT;

DELIMITER //

CREATE TRIGGER `ImportScriptBackup_ai` AFTER INSERT ON `ImportScriptBackups` FOR EACH ROW

BEGIN

  UPDATE `APITokens`
	SET `lastUsed` = NOW(),
		`requests` = (`requests` + 1)
	WHERE `token` = new.authorization;

END
//

COMMIT //

DELIMITER ;
