Skip to content

Instantly share code, notes, and snippets.

@james2doyle
Created October 7, 2019 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save james2doyle/91fe2401f51a181cb5713c112f41f166 to your computer and use it in GitHub Desktop.
Save james2doyle/91fe2401f51a181cb5713c112f41f166 to your computer and use it in GitHub Desktop.
An SQL statement for Laravel database queue that removes duplicate jobs
DELETE `t1` FROM `jobs` `t1`
INNER JOIN `jobs` `t2`
WHERE `t1`.`id` < `t2`.`id`
AND `t1`.`payload` = `t2`.`payload`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment