0.2.45 - Advanced analytics, logout old versions
This commit is contained in:
@@ -155,6 +155,34 @@ CREATE TABLE IF NOT EXISTS row_events (
|
||||
CREATE INDEX IF NOT EXISTS row_events_time_idx ON row_events (occurred_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS row_events_row_idx ON row_events (row_id, occurred_at DESC);
|
||||
|
||||
-- Significant, user-scoped app journeys. Values are deliberately categorical: content
|
||||
-- names, search terms, setting values and other free text do not belong in this table.
|
||||
-- journey_id is generated by the client for one foreground visit; emby_user_id is always
|
||||
-- taken from the authenticated gateway session rather than trusted from the payload.
|
||||
CREATE TABLE IF NOT EXISTS journey_events (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
occurred_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
emby_user_id TEXT NOT NULL,
|
||||
journey_id TEXT NOT NULL,
|
||||
sequence INT NOT NULL DEFAULT 0,
|
||||
category TEXT NOT NULL,
|
||||
action TEXT NOT NULL,
|
||||
screen TEXT NOT NULL DEFAULT '',
|
||||
feature TEXT NOT NULL DEFAULT '',
|
||||
source TEXT NOT NULL DEFAULT '',
|
||||
target TEXT NOT NULL DEFAULT '',
|
||||
item_id TEXT NOT NULL DEFAULT '',
|
||||
item_type TEXT NOT NULL DEFAULT '',
|
||||
outcome TEXT NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS journey_events_journey_sequence_idx
|
||||
ON journey_events (emby_user_id, journey_id, sequence);
|
||||
CREATE INDEX IF NOT EXISTS journey_events_user_time_idx
|
||||
ON journey_events (emby_user_id, occurred_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS journey_events_feature_time_idx
|
||||
ON journey_events (feature, occurred_at DESC);
|
||||
|
||||
-- Search terms are retained separately from row engagement so they can inform future
|
||||
-- ranking/recommendation work without coupling that analysis to rendered rows.
|
||||
CREATE TABLE IF NOT EXISTS search_history (
|
||||
|
||||
Reference in New Issue
Block a user