研究了一下mastodon的数据库表结构,找到了用tootctl accounts delete删除用户后,彻底清除用户记录并释放用户名的方法——用toolctl删除后,在psql里运行:
select id, username from accounts where domain is null and id not in (select account_id from users);
检查确认是用toolctl删除的用户后,然后用:
delete * from accounts where id in (上一条命令里得到的account id列表);
即可批量释放,不需要去一个一个找account id。
是看了https://www.b612.me/default/123.html 这片博客后的一个优化。
@yun5s 咦,我都忘了还有这档子事了…