mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 13:17:19 +01:00
update schema and queries to implement reset_at
This commit is contained in:
parent
43ef6884df
commit
14e4a090bb
15 changed files with 74 additions and 59 deletions
|
|
@ -49,8 +49,6 @@ export async function resetWebsite(
|
|||
): Promise<[Prisma.BatchPayload, Prisma.BatchPayload, Website]> {
|
||||
const { client, transaction } = prisma;
|
||||
|
||||
const { revId } = await getWebsite({ id: websiteId });
|
||||
|
||||
return transaction([
|
||||
client.websiteEvent.deleteMany({
|
||||
where: { websiteId },
|
||||
|
|
@ -58,7 +56,12 @@ export async function resetWebsite(
|
|||
client.session.deleteMany({
|
||||
where: { websiteId },
|
||||
}),
|
||||
client.website.update({ where: { id: websiteId }, data: { revId: revId + 1 } }),
|
||||
client.website.update({
|
||||
where: { id: websiteId },
|
||||
data: {
|
||||
resetAt: new Date(),
|
||||
},
|
||||
}),
|
||||
]).then(async data => {
|
||||
if (cache.enabled) {
|
||||
await cache.storeWebsite(data[2]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue