Files
the-biergarten-app/prisma/seed/clean/cleanDatabase.ts
2023-01-22 23:49:58 -05:00

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;