Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last Activities VIEW #25

Open
nadnoslen opened this issue Oct 30, 2018 · 0 comments
Open

Last Activities VIEW #25

nadnoslen opened this issue Oct 30, 2018 · 0 comments

Comments

@nadnoslen
Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant