OAuth Email missing in data explorer

Using this query:

SELECT id, username, email
FROM users

The following is returned
pixelized

All those NULL results are people who have signed up using Google OAuth2

The emails are in the system correctly, I can see them in their profiles.

What am I doing wrong? :slight_smile:

We no longer use the email column on the users table.

You need to join the users table with the user_emails table with the primary = true condition :wink:

3 Likes
SELECT u.id, u.username, u.email, ue.email
FROM users u
INNER JOIN user_emails ue ON u.id = ue.id
WHERE ue.primary = true

That worked :slight_smile:

I was thrown off by the one email that was there; but I guess that’s a remnant of running

cd /var/discourse
./launcher enter app
rake admin:create

when I was troubleshooting my email troubles.

2 Likes

The column is in readonly mode. We’ll completely remove it when we’re 100% it’s safe to do so.

4 Likes