Merge branch 'dev' into feat-2FA

This commit is contained in:
Mike Cao authored and GitHub committed 2026-07-23 11:14:59 -07:00
commit aafe068bc1
559 files changed
+21955 -9347

No files matched your search

@@ -0,0 +1,33 @@
ALTER TABLE "website" RENAME COLUMN "replay_enabled" TO "recorder_enabled";
UPDATE "website"
SET "replay_config" = COALESCE("replay_config", '{}'::jsonb) || '{"replayEnabled": true}'::jsonb
WHERE "recorder_enabled" = true;
-- CreateTable
CREATE TABLE "heatmap_event" (
"heatmap_event_id" UUID NOT NULL,
"website_id" UUID NOT NULL,
"session_id" UUID NOT NULL,
"visit_id" UUID NOT NULL,
"url_path" VARCHAR(500) NOT NULL,
"event_type" INTEGER NOT NULL,
"x" INTEGER,
"y" INTEGER,
"page_x" INTEGER,
"page_y" INTEGER,
"page_w" INTEGER,
"viewport_w" INTEGER,
"viewport_h" INTEGER,
"page_h" INTEGER,
"scroll_pct" INTEGER,
"created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "heatmap_event_pkey" PRIMARY KEY ("heatmap_event_id")
);
-- CreateIndex
CREATE INDEX "heatmap_event_website_id_idx" ON "heatmap_event"("website_id");
CREATE INDEX "heatmap_event_visit_id_idx" ON "heatmap_event"("visit_id");
CREATE INDEX "heatmap_event_website_id_created_at_idx" ON "heatmap_event"("website_id", "created_at");
CREATE INDEX "heatmap_event_website_id_url_path_event_type_created_at_idx" ON "heatmap_event"("website_id", "url_path", "event_type", "created_at");
@@ -0,0 +1,11 @@
-- CreateTable
CREATE TABLE "session_link" (
"website_id" UUID NOT NULL,
"session_id" UUID NOT NULL,
"distinct_id" VARCHAR(50) NOT NULL,
"created_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "session_link_pkey" PRIMARY KEY ("website_id","distinct_id","session_id")
);
CREATE INDEX "session_link_website_id_session_id_idx" ON "session_link"("website_id", "session_id");
+29 -15
View File
@@ -66,22 +66,35 @@ model Session {
@@map("session")
}
model SessionLink {
websiteId String @map("website_id") @db.Uuid
sessionId String @map("session_id") @db.Uuid
distinctId String @map("distinct_id") @db.VarChar(50)
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
@@id([websiteId, distinctId, sessionId])
@@index([websiteId, sessionId])
@@map("session_link")
}
model Website {
id String @id @map("website_id") @db.Uuid
name String @db.VarChar(100)
domain String? @db.VarChar(500)
resetAt DateTime? @map("reset_at") @db.Timestamptz(6)
userId String? @map("user_id") @db.Uuid
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6)
deletedAt DateTime? @map("deleted_at") @db.Timestamptz(6)
createdBy String? @map("created_by") @db.Uuid
teamId String? @map("team_id") @db.Uuid
replayEnabled Boolean @default(false) @map("replay_enabled")
replayConfig Json? @map("replay_config")
user User? @relation("user", fields: [userId], references: [id])
createUser User? @relation("createUser", fields: [createdBy], references: [id])
team Team? @relation(fields: [teamId], references: [id])
id String @id() @map("website_id") @db.Uuid
name String @db.VarChar(100)
domain String? @db.VarChar(500)
resetAt DateTime? @map("reset_at") @db.Timestamptz(6)
userId String? @map("user_id") @db.Uuid
teamId String? @map("team_id") @db.Uuid
createdBy String? @map("created_by") @db.Uuid
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6)
deletedAt DateTime? @map("deleted_at") @db.Timestamptz(6)
recorderEnabled Boolean @default(false) @map("recorder_enabled")
replayConfig Json? @map("replay_config")
user User? @relation("user", fields: [userId], references: [id])
createUser User? @relation("createUser", fields: [createdBy], references: [id])
team Team? @relation(fields: [teamId], references: [id])
eventData EventData[]
reports Report[]
revenue Revenue[]
@@ -89,6 +102,7 @@ model Website {
sessionData SessionData[]
sessionReplays SessionReplay[]
sessionReplaysSaved SessionReplaySaved[]
heatmapEvents HeatmapEvent[]
@@index([userId])
@@index([teamId])