doordie(db,"update files set content = '', local = 0 where length(content) > 20000 and fileid in (select fileid from donks join honks on donks.honkid = honks.honkid where honks.dt < ? and whofore = 0) and fileid not in (select fileid from donks join honks on donks.honkid = honks.honkid where whofore = 2 or whofore = 3)",expdate)
doordie(db,"delete from donks where honkid in (select honkid from honks where dt < ? and whofore = 0)",expdate)
doordie(db,"delete from honks where dt < ? and whofore = 0",expdate)
doordie(db,"delete from files where fileid not in (select fileid from donks)")