mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Edit seed db function
This commit is contained in:
13
prisma/seed/clean/cleanDatabase.ts
Normal file
13
prisma/seed/clean/cleanDatabase.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user