Files
zeekay eb9a9887d0 fix: complete umami purge and get all 34 e2e tests passing
- Replace @umami/* imports with @hanzo/* npm aliases in package.json
- Rename redis client to KVClient (UmamiRedisClient as KVClient)
- Rename collector/forward/umami.go → analytics.go (git mv)
- Remove all umami backwards-compat aliases from tracker (data-umami-event,
  window.umami, umami.disabled localStorage, eventNameAttributeLegacy)
- Purge 93 umami. prefixes from ClickHouse SQL migrations
- Update default admin password hash from "umami" to "analytics"
- Rebrand podman service files, GitHub Actions, telemetry URL, seed scripts
- Add data-test attributes to WebsiteAddButton, WebsitesTable, UserAddForm,
  UserEditForm for Cypress test compatibility
- Refactor UsersTable: replace MenuButton portal dropdown with inline
  LinkButton (edit) + Button (delete) so Cypress .within() can find them
- Fix Cypress tests: update selectors (td[label] → cy.contains), remove
  stale tab-navigation (settings page is vertical, not tabbed), scope
  button[type=submit] to [role=dialog] for delete confirmation
- All 34 Cypress e2e tests now pass (was 28/34)
2026-02-27 16:46:39 -08:00

90 lines
2.1 KiB
SQL

CREATE TABLE analytics.website_event_join
(
session_id UUID,
visit_id UUID,
created_at DateTime('UTC')
)
engine = MergeTree
ORDER BY (session_id, created_at)
SETTINGS index_granularity = 8192;
INSERT INTO analytics.website_event_join
SELECT DISTINCT
s.session_id,
generateUUIDv4() visit_id,
s.created_at
FROM (SELECT DISTINCT session_id,
date_trunc('hour', created_at) created_at
FROM website_event) s;
-- create new table
CREATE TABLE analytics.website_event_new
(
website_id UUID,
session_id UUID,
visit_id UUID,
event_id UUID,
hostname LowCardinality(String),
browser LowCardinality(String),
os LowCardinality(String),
device LowCardinality(String),
screen LowCardinality(String),
language LowCardinality(String),
country LowCardinality(String),
subdivision1 LowCardinality(String),
subdivision2 LowCardinality(String),
city String,
url_path String,
url_query String,
referrer_path String,
referrer_query String,
referrer_domain String,
page_title String,
event_type UInt32,
event_name String,
created_at DateTime('UTC'),
job_id UUID
)
engine = MergeTree
ORDER BY (website_id, session_id, created_at)
SETTINGS index_granularity = 8192;
INSERT INTO analytics.website_event_new
SELECT we.website_id,
we.session_id,
j.visit_id,
we.event_id,
we.hostname,
we.browser,
we.os,
we.device,
we.screen,
we.language,
we.country,
we.subdivision1,
we.subdivision2,
we.city,
we.url_path,
we.url_query,
we.referrer_path,
we.referrer_query,
we.referrer_domain,
we.page_title,
we.event_type,
we.event_name,
we.created_at,
we.job_id
FROM analytics.website_event we
JOIN analytics.website_event_join j
ON we.session_id = j.session_id
and date_trunc('hour', we.created_at) = j.created_at
RENAME TABLE analytics.website_event TO analytics.website_event_old;
RENAME TABLE analytics.website_event_new TO analytics.website_event;
/*
DROP TABLE analytics.website_event_old
DROP TABLE analytics.website_event_join
*/