Skip to content

DB schema for card views and platform clicks #668

Description

@ShantKhatri

Summary

Set up the two core tables analytics is built on: card_view and platform_click.

Contexts

This is the foundation for every other analytics issue. Needs to support hashed, non-reversible session tokens so no individual viewer is ever identifiable.

Tasks

  • Create card_view table (id, card_id, session_token, source, event_id, timestamp)
  • Create platform_click table (id, card_id, platform, session_token, timestamp)
  • Add indexes on card_id and timestamp for both tables
  • Define what counts as a "unique view" and document it

Acceptance Criteria

  • Migrations run cleanly up and down
  • Schema reviewed against privacy note (no reversible tokens)
  • Tests added
  • docs updated

Area

backend

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions