-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
It's always nice to have the last of some user. For example, last seen would be the USERS' most recently created SESSION_ACTIVITIES record. This could be a column derived in a VIEW and could easily be rendered as a relationship to a USERS record.
CREATE VIEW users_last_activities AS
SELECT users.id,
(
SELECT MAX(sa.created_at)
FROM session_activities sa INNER JOIN sessions s
ON sa.session_id=s.id
WHERE s.user_id=users.id
),
...
FROM users
Other last ideas from projects I've worked on:
- last emailed
- last IP
- last browser
Metadata
Metadata
Assignees
Labels
No labels