mirror of
https://github.com/krateng/maloja.git
synced 2025-06-03 21:54:45 -04:00
Add some DB maintenance
This commit is contained in:
parent
ac5c58c919
commit
f4a5c2fb3d
@ -1705,6 +1705,11 @@ def clean_db(dbconn=None):
|
|||||||
log(f"Database Cleanup...")
|
log(f"Database Cleanup...")
|
||||||
|
|
||||||
to_delete = [
|
to_delete = [
|
||||||
|
# NULL associations
|
||||||
|
"from albumartists where album_id is NULL",
|
||||||
|
"from albumartists where artist_id is NULL",
|
||||||
|
"from trackartists where track_id is NULL",
|
||||||
|
"from trackartists where artist_id is NULL",
|
||||||
# tracks with no scrobbles (trackartist entries first)
|
# tracks with no scrobbles (trackartist entries first)
|
||||||
"from trackartists where track_id in (select id from tracks where id not in (select track_id from scrobbles))",
|
"from trackartists where track_id in (select id from tracks where id not in (select track_id from scrobbles))",
|
||||||
"from tracks where id not in (select track_id from scrobbles)",
|
"from tracks where id not in (select track_id from scrobbles)",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user