Skip to content

Instantly share code, notes, and snippets.

@pooza
Last active December 7, 2018 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pooza/c405038268627070ecbc34198509c766 to your computer and use it in GitHub Desktop.
Save pooza/c405038268627070ecbc34198509c766 to your computer and use it in GitHub Desktop.
SELECT
accounts.id
FROM accounts
LEFT JOIN users ON accounts.id=users.account_id
LEFT JOIN (
SELECT
account_id
FROM blocks
WHERE target_account_id=1
) AS blockers ON accounts.id=blockers.account_id
LEFT JOIN (
SELECT
account_id
FROM mutes
WHERE target_account_id=1
) AS muters ON accounts.id=muters.account_id
WHERE (accounts.domain IS NULL)
AND ((accounts.actor_type='Person') OR (accounts.actor_type IS NULL))
AND (accounts.silenced='f')
AND (accounts.suspended='f')
AND (blockers.account_id IS NULL)
AND (muters.account_id IS NULL)
AND (users.disabled='f')
GROUP BY accounts.id;
@pooza
Copy link
Author

pooza commented Dec 7, 2018

管理者のアカウントIDを1として。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment