Remove IP tracking columns from users table (#16409)
This commit is contained in:
parent
b52fdb4c6f
commit
8e84ebf0cb
19 changed files with 141 additions and 75 deletions
26
db/views/user_ips_v01.sql
Normal file
26
db/views/user_ips_v01.sql
Normal file
|
@ -0,0 +1,26 @@
|
|||
SELECT
|
||||
user_id,
|
||||
ip,
|
||||
max(used_at) AS used_at
|
||||
FROM (
|
||||
SELECT
|
||||
id AS user_id,
|
||||
sign_up_ip AS ip,
|
||||
created_at AS used_at
|
||||
FROM users
|
||||
WHERE sign_up_ip IS NOT NULL
|
||||
UNION ALL
|
||||
SELECT
|
||||
user_id,
|
||||
ip,
|
||||
updated_at
|
||||
FROM session_activations
|
||||
UNION ALL
|
||||
SELECT
|
||||
user_id,
|
||||
ip,
|
||||
created_at
|
||||
FROM login_activities
|
||||
WHERE success = 't'
|
||||
) AS t0
|
||||
GROUP BY user_id, ip
|
Loading…
Add table
Add a link
Reference in a new issue