File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 11import fs from 'node:fs'
22import { faker } from '@faker-js/faker'
3- import { type PrismaClient } from '@prisma/client'
3+ import { Prisma , type PrismaClient } from '@prisma/client'
44import bcrypt from 'bcryptjs'
55import { UniqueEnforcer } from 'enforce-unique'
66
@@ -145,11 +145,16 @@ export async function cleanupDb(prisma: PrismaClient) {
145145 . filter ( Boolean )
146146
147147 // Run each sql statement in the migration
148- await prisma . $transaction ( [
149- ...statements . map ( ( statement ) =>
150- prisma . $executeRawUnsafe ( `${ statement } ` ) ,
151- ) ,
152- ] )
148+ await prisma . $transaction (
149+ [
150+ ...statements . map ( ( statement ) =>
151+ prisma . $executeRawUnsafe ( `${ statement } ` ) ,
152+ ) ,
153+ ] ,
154+ {
155+ isolationLevel : Prisma . TransactionIsolationLevel . Serializable ,
156+ } ,
157+ )
153158 }
154159 } catch ( error ) {
155160 console . error ( 'Error cleaning up database:' , error )
You can’t perform that action at this time.
0 commit comments