An automatic group of group owners

I’ve just implemented a Triggered custom badge queries for identifying current group owners.

The SQL for it is here (can be used in Data Explorer too)

SELECT DISTINCT user_id, owner, CURRENT_TIMESTAMP granted_at
FROM group_users
WHERE group_users.owner = true

It uses CURRENT_TIMESTAMP as there is no nice convenient timestamp for group ownership in the database that I can see. There is no nice trigger either so the :backfill thing can be omitted

I suggest this config:

  1. Run revocation query daily
  2. Trigger: Update daily
  3. I’m not sure about ‘Can be granted multiple times’
    The query only fires once for each user so multiple won’t be granted. But it might be needed to have the badge granted again once revoked - no sure!
4 Likes