Restructure codebase to use src directory

This commit is contained in:
Aaron William Po
2023-04-11 23:32:06 -04:00
parent 90f2cc2c0c
commit 08422fe24e
141 changed files with 6 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
import DBClient from '../../DBClient';
const cleanDatabase = async () => {
const prisma = DBClient.instance;
await prisma.$executeRaw`TRUNCATE TABLE "User" CASCADE`;
await prisma.$executeRaw`TRUNCATE TABLE "BeerPost" CASCADE`;
await prisma.$executeRaw`TRUNCATE TABLE "BeerType" CASCADE`;
await prisma.$executeRaw`TRUNCATE TABLE "BreweryPost" CASCADE`;
await prisma.$executeRaw`TRUNCATE TABLE "BeerComment" CASCADE`;
await prisma.$executeRaw`TRUNCATE TABLE "BreweryComment" CASCADE`;
await prisma.$executeRaw`TRUNCATE TABLE "BeerPostLike" CASCADE`;
await prisma.$executeRaw`TRUNCATE TABLE "BeerImage" CASCADE`;
await prisma.$executeRaw`TRUNCATE TABLE "BreweryImage" CASCADE`;
await prisma.$disconnect();
};
export default cleanDatabase;