diff --git a/backend/src/seed/factories/index.js b/backend/src/seed/factories/index.js index 10db5cc03..8b80a4b4f 100644 --- a/backend/src/seed/factories/index.js +++ b/backend/src/seed/factories/index.js @@ -29,10 +29,16 @@ const factories = { export const cleanDatabase = async (options = {}) => { const { driver = getDriver() } = options - const cypher = 'MATCH (n) DETACH DELETE n' const session = driver.session() try { - return await session.run(cypher) + await session.writeTransaction(transaction => { + return transaction.run( + ` + MATCH (everything) + DETACH DELETE everything + `, + ) + }) } finally { session.close() }