Elektrine lite

← Feed

@tim@union.place

Post #1458048

2026-04-18 16:38 UTC

Fellow #MastoAdmin people: if you need to track down all users invited by a particular user, here's an SQL query (disclosure: generated by Gemini, vetted and validated by me): see next post.

Replies (3)

  • @tim@union.place 2026-04-18 16:38

    SELECT invited_accounts.username AS invited_user, invited_users.created_at AS join_date FROM users AS invited_users JOIN accounts AS invited_accounts ON invited_users.account_id = invited_accounts.id WHERE invited_users.invite_id IN ( SELECT id FROM invites WHERE user_id = ( SELECT id FROM users WHERE account_id = ( SELECT id FROM accounts WHERE username = 'USER' AND domain IS NULL ) ) );

    Open ##2041496

  • @M0YNG@mastodon.radio 2026-04-18 20:59

    @tim I disabled user invites ages ago because they bypass the normal approvals process. If people want to invite other people they can sign up and say they were invited.

    Open ##2041504

  • @tek@freeradical.zone 2026-04-19 05:19

    @tim Here's users and the people who invited them, by date: select u1.created_at, a1.username as sender, a2.username as recipient from users as u1 join invites on u1.invite_id = invites.id join users as u2 on invites.user_id = u2.id join accounts as a1 on u2.account_id = a1.id join accounts as a2 on u1.account_id = a2.id where u1.invite_id is not null order by u1.created_at; Edit: oops, forget a join

    Open ##2041505