Skip to content

Commit

Permalink
add cascading delete to sessionData
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscao633 committed Aug 28, 2024
1 parent ff0c825 commit 13c7dd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/queries/prisma/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ export async function deleteUser(
client.eventData.deleteMany({
where: { websiteId: { in: websiteIds } },
}),
client.sessionData.deleteMany({
where: { websiteId: { in: websiteIds } },
}),
client.websiteEvent.deleteMany({
where: { websiteId: { in: websiteIds } },
}),
Expand Down
6 changes: 6 additions & 0 deletions src/queries/prisma/website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ export async function resetWebsite(
client.eventData.deleteMany({
where: { websiteId },
}),
client.sessionData.deleteMany({
where: { websiteId },
}),
client.websiteEvent.deleteMany({
where: { websiteId },
}),
Expand Down Expand Up @@ -195,6 +198,9 @@ export async function deleteWebsite(
client.eventData.deleteMany({
where: { websiteId },
}),
client.sessionData.deleteMany({
where: { websiteId },
}),
client.websiteEvent.deleteMany({
where: { websiteId },
}),
Expand Down

0 comments on commit 13c7dd6

Please sign in to comment.