Last active
September 9, 2024 15:00
-
-
Save vyspiansky/0ba7da6e53531c0893abbda27f81a92a to your computer and use it in GitHub Desktop.
Clear older recent log messages in Drupal 10, retaining only the last 500
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
-- Remove all watchdog's records from a MySQL table except for the last 500. | |
DELETE FROM `watchdog` | |
WHERE wid NOT IN ( | |
SELECT wid | |
FROM ( | |
SELECT wid | |
FROM `watchdog` | |
ORDER BY wid DESC | |
LIMIT 500 | |
) AS t | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment