mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
14 lines
532 B
TypeScript
14 lines
532 B
TypeScript
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`;
|
|
};
|
|
|
|
export default cleanDatabase;
|