Adds perge-tags option

This commit is contained in:
Jonathan Hodgson 2020-12-30 17:42:22 +00:00
parent 6206986546
commit a504c212ef
2 changed files with 9 additions and 0 deletions

View file

@ -75,3 +75,10 @@ listTags(){
GROUP BY tags.id" |
sqlite3 --column $header "${sqliteFile}"
}
purgeTags(){
vecho "purgeTags $*"
echo "DELETE FROM tags WHERE id IN (
SELECT id FROM tags WHERE id NOT IN (SELECT tagID FROM links)
)"| sqlite3 --column --header "${sqliteFile}"
}