Skip to content

Commit

Permalink
do not cascade truncate for clear social data
Browse files Browse the repository at this point in the history
  • Loading branch information
hubsmoke committed Feb 19, 2024
1 parent 42428f3 commit bf4c699
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions desci-server/src/scripts/DESTRUCTIVE-clear-social-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ export const clearSocialData = async () => {
desciCommunityId: { not: undefined },
},
});
await prisma.$queryRaw`TRUNCATE TABLE "DesciCommunity" CASCADE`;
await prisma.$queryRaw`TRUNCATE TABLE "Attestation" CASCADE`;
await prisma.$queryRaw`TRUNCATE TABLE "NodeAttestation" CASCADE`;
await prisma.communitySelectedAttestation.deleteMany({});
await prisma.nodeAttestationReaction.deleteMany({});
await prisma.nodeAttestationVerification.deleteMany({});
await prisma.attestationVersion.deleteMany({});
await prisma.nodeAttestation.deleteMany({});
await prisma.attestation.deleteMany({});
await prisma.desciCommunity.deleteMany({});
};

if (process.env.RUN) {
Expand Down

0 comments on commit bf4c699

Please sign in to comment.