Created
October 7, 2019 17:58
-
-
Save james2doyle/91fe2401f51a181cb5713c112f41f166 to your computer and use it in GitHub Desktop.
An SQL statement for Laravel database queue that removes duplicate jobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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