From 90ebc90aa1f25c342c7494549ecce77325e26913 Mon Sep 17 00:00:00 2001 From: gmbronco <83549293+gmbronco@users.noreply.github.com> Date: Fri, 12 Jan 2024 19:01:28 +0100 Subject: [PATCH] delete cleanup based on constraints --- modules/pool/pool.service.ts | 45 ------------------------------------ 1 file changed, 45 deletions(-) diff --git a/modules/pool/pool.service.ts b/modules/pool/pool.service.ts index 69ecdba5..823b0e6c 100644 --- a/modules/pool/pool.service.ts +++ b/modules/pool/pool.service.ts @@ -374,13 +374,8 @@ export class PoolService { where: { chain: this.chain, poolId: poolId }, }); - const poolTokenIds = poolTokens.map((poolToken) => poolToken.id); const poolTokenAddresses = poolTokens.map((poolToken) => poolToken.address); - await prisma.prismaPoolSnapshot.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - await prisma.prismaTokenType.deleteMany({ where: { chain: this.chain, tokenAddress: pool.address }, }); @@ -389,50 +384,10 @@ export class PoolService { where: { chain: this.chain, poolId: poolId }, }); - await prisma.prismaPoolTokenDynamicData.deleteMany({ - where: { chain: this.chain, poolTokenId: { in: poolTokenIds } }, - }); - await prisma.prismaTokenDynamicData.deleteMany({ where: { chain: this.chain, tokenAddress: { in: poolTokenAddresses } }, }); - await prisma.prismaPoolToken.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - - await prisma.prismaPoolDynamicData.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - - await prisma.prismaPoolToken.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - - await prisma.prismaPoolLinearData.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - - await prisma.prismaPoolGyroData.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - - await prisma.prismaPoolExpandedTokens.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - - await prisma.prismaPoolLinearDynamicData.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - - await prisma.prismaPoolAprItem.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - - await prisma.prismaPoolSwap.deleteMany({ - where: { chain: this.chain, poolId: poolId }, - }); - const poolStaking = await prisma.prismaPoolStaking.findMany({ where: { chain: this.chain, poolId: poolId }, });