heatmap migration/code clean-up

This commit is contained in:
Francis Cao committed 2026-06-23 15:01:00 -07:00
1 parent 3888ec6f4f
commit 8a0bdc2727
13 files changed
+49 -1326

No files matched your search

-55
View File
@@ -89,8 +89,6 @@ model Website {
sessionReplays SessionReplay[]
sessionReplaysSaved SessionReplaySaved[]
heatmapEvents HeatmapEvent[]
heatmapReplayPreviews HeatmapReplayPreview[]
heatmapSnapshots HeatmapSnapshot[]
@@index([userId])
@@index([teamId])
@@ -410,7 +408,6 @@ model HeatmapEvent {
visitId String @map("visit_id") @db.Uuid
urlPath String @map("url_path") @db.VarChar(500)
eventType Int @map("event_type") @db.Integer
nodeId Int? @map("node_id") @db.Integer
x Int? @db.Integer
y Int? @db.Integer
pageX Int? @map("page_x") @db.Integer
@@ -420,9 +417,6 @@ model HeatmapEvent {
viewportH Int? @map("viewport_h") @db.Integer
pageH Int? @map("page_h") @db.Integer
scrollPct Int? @map("scroll_pct") @db.Integer
replayChunkIndex Int? @map("replay_chunk_index") @db.Integer
replayEventIndex Int? @map("replay_event_index") @db.Integer
replayTimeMs BigInt? @map("replay_time_ms") @db.BigInt
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
website Website @relation(fields: [websiteId], references: [id])
@@ -431,54 +425,5 @@ model HeatmapEvent {
@@index([visitId])
@@index([websiteId, createdAt])
@@index([websiteId, urlPath, eventType, createdAt])
@@index([websiteId, visitId, replayChunkIndex, replayEventIndex])
@@map("heatmap_event")
}
model HeatmapReplayPreview {
id String @id() @map("preview_id") @db.Uuid
websiteId String @map("website_id") @db.Uuid
sessionId String @map("session_id") @db.Uuid
visitId String @map("visit_id") @db.Uuid
urlPath String @map("url_path") @db.VarChar(500)
viewportW Int @map("viewport_w") @db.Integer
viewportH Int @map("viewport_h") @db.Integer
replayChunkIndex Int @map("replay_chunk_index") @db.Integer
replayEventIndex Int @map("replay_event_index") @db.Integer
replayTimeMs BigInt? @map("replay_time_ms") @db.BigInt
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6)
website Website @relation(fields: [websiteId], references: [id])
@@unique([websiteId, urlPath, viewportW, viewportH])
@@index([websiteId])
@@index([visitId])
@@index([websiteId, urlPath])
@@map("heatmap_replay_preview")
}
model HeatmapSnapshot {
id String @id() @map("snapshot_id") @db.Uuid
websiteId String @map("website_id") @db.Uuid
urlPath String @map("url_path") @db.VarChar(500)
viewportW Int @map("viewport_w") @db.Integer
viewportH Int @map("viewport_h") @db.Integer
pageW Int @map("page_w") @db.Integer
pageH Int @map("page_h") @db.Integer
status String @db.VarChar(20)
mimeType String? @map("mime_type") @db.VarChar(100)
imageData Bytes? @map("image_data")
imageSize Int? @map("image_size") @db.Integer
error String? @db.VarChar(500)
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6)
website Website @relation(fields: [websiteId], references: [id])
@@unique([websiteId, urlPath, viewportW, viewportH])
@@index([websiteId])
@@index([websiteId, urlPath])
@@index([websiteId, updatedAt])
@@map("heatmap_snapshot")
}