Skip to content

Instantly share code, notes, and snippets.

View Tummerhore's full-sized avatar

Lukas Schätzle Tummerhore

View GitHub Profile
@Tummerhore
Tummerhore / directus-cleaning.sql
Last active January 18, 2024 13:16
Directus (MySQL): Remove old activities, revisions, flow logs, notifications
/*
DISCLAIMER: Use at your own risk!
Tested with Directus 9.23.4 and MySQL
This will delete all flow execution logs, revisions and acitivites which are older
than the specified MinTimestamp and are not in the top <specified MinItems> latest
items. Activities related to saved revisions / flow logs are also saved even when
they normally would have been deleted.
Archived notifiactions are deleted when the creation of the notifaction is older