summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/sql/maintenance/pruneEvents.sql
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-07-30 15:57:53 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2017-07-30 15:57:53 +0100
commited2885ac4d872a8ff7bd2ede57adfc002d9d78ba (patch)
treef7d28093c0f01e9070ea1796375c62b4a238175a /p2pvr/daemon/sql/maintenance/pruneEvents.sql
parentBIG migration from Project2 based to IceTray/Slicer :D (diff)
downloadp2pvr-ed2885ac4d872a8ff7bd2ede57adfc002d9d78ba.tar.bz2
p2pvr-ed2885ac4d872a8ff7bd2ede57adfc002d9d78ba.tar.xz
p2pvr-ed2885ac4d872a8ff7bd2ede57adfc002d9d78ba.zip
Tidy SQL statements into sub-dirs
Diffstat (limited to 'p2pvr/daemon/sql/maintenance/pruneEvents.sql')
-rw-r--r--p2pvr/daemon/sql/maintenance/pruneEvents.sql4
1 files changed, 4 insertions, 0 deletions
diff --git a/p2pvr/daemon/sql/maintenance/pruneEvents.sql b/p2pvr/daemon/sql/maintenance/pruneEvents.sql
new file mode 100644
index 0000000..b6f1d1b
--- /dev/null
+++ b/p2pvr/daemon/sql/maintenance/pruneEvents.sql
@@ -0,0 +1,4 @@
+DELETE FROM events e
+WHERE e.eventuid NOT IN (SELECT eventuid FROM recorded)
+AND e.eventuid NOT IN (SELECT eventuid FROM recordings)
+AND NOT current