Merge branch 'dev' into analytics

This commit is contained in:
Mike Cao 2023-04-07 11:49:31 -07:00
commit a33706585b
3 changed files with 7 additions and 1 deletions

View File

@ -161,6 +161,9 @@ export async function deleteUser(
return prisma
.transaction([
client.eventData.deleteMany({
where: { websiteId: { in: websiteIds } },
}),
client.websiteEvent.deleteMany({
where: { websiteId: { in: websiteIds } },
}),

View File

@ -78,6 +78,9 @@ export async function deleteWebsite(
const cloudMode = process.env.CLOUD_MODE;
return transaction([
client.eventData.deleteMany({
where: { websiteId },
}),
client.websiteEvent.deleteMany({
where: { websiteId },
}),

View File

@ -35,7 +35,7 @@ function clickhouseQuery(websiteId: string, startAt: Date, eventType: number) {
url_path,
event_name as eventName
from website_event
where event_type = {eventType:Uint32}
where event_type = {eventType:UInt32}
and website_id = {websiteId:UUID}
and created_at >= {startAt:DateTime('UTC')}`,
{