Skip to content

Last Activities VIEW #25

@nadnoslen

Description

@nadnoslen

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions