Hi
I’m also interested in this, and have come to the same solutions as you guys. I use a psql select to obtain user information including the last update date and the last activity date:
SELECT users.username, users.firstname, users.lastname, users.email, to_timestamp(users.createat/1000) AS createat, to_timestamp(users.updateat/1000) AS updateat, to_timestamp(sessions.lastactivityat/1000) AS LastActivityAt from users left join sessions on sessions.userid = users.id order by users.username, lastactivityat;
I hoped that using this information I could decide which users I could delete, but alas, when analyzing the output I found a colleague with an empty lastactivityat field, and an updateat from last month, that I had been chatting with on mattermost just yesterday.
If I automate this, as I intend to, he would have been unjustly removed.
Am I doing something wrong? Or is lastactivityat not the right place to look for the information we need? Has anyone figured this out?
BTW, apparently DeleteAt != 0 gives users that have been deactivated by the administrator, it has nothing to do with real user activity (or with “deleted” users).