@@ -16,7 +16,7 @@ test('When we use the fastify-postgres transaction route option', t => {
1616 connectionString
1717 } )
1818
19- await fastify . pg . query ( 'TRUNCATE users' )
19+ await fastify . pg . query ( 'DELETE FROM " users" WHERE TRUE ' )
2020
2121 fastify . get ( '/count-users' , async ( req , reply ) => {
2222 const result = await fastify . pg . query ( 'SELECT COUNT(*) AS "userCount" FROM users WHERE username=\'pass-opt-in\'' )
@@ -49,7 +49,7 @@ test('When we use the fastify-postgres transaction route option', t => {
4949 name : 'test'
5050 } )
5151
52- await fastify . pg . test . query ( 'TRUNCATE users' )
52+ await fastify . pg . test . query ( 'DELETE FROM " users" WHERE TRUE ' )
5353
5454 fastify . get ( '/count-users' , async ( req , reply ) => {
5555 const result = await fastify . pg . test . query ( 'SELECT COUNT(*) AS "userCount" FROM users WHERE username=\'pass-opt-in\'' )
@@ -82,7 +82,7 @@ test('When we use the fastify-postgres transaction route option', t => {
8282 connectionString
8383 } )
8484
85- await fastify . pg . query ( 'TRUNCATE users' )
85+ await fastify . pg . query ( 'DELETE FROM " users" WHERE TRUE ' )
8686
8787 fastify . get ( '/count-users' , async ( req , reply ) => {
8888 const result = await fastify . pg . query ( 'SELECT COUNT(*) AS "userCount" FROM users WHERE username=\'fail-opt-in\'' )
@@ -117,7 +117,7 @@ test('When we use the fastify-postgres transaction route option', t => {
117117 name : 'test'
118118 } )
119119
120- await fastify . pg . test . query ( 'TRUNCATE users' )
120+ await fastify . pg . test . query ( 'DELETE FROM " users" WHERE TRUE ' )
121121
122122 fastify . get ( '/count-users' , async ( req , reply ) => {
123123 const result = await fastify . pg . test . query ( 'SELECT COUNT(*) AS "userCount" FROM users WHERE username=\'fail-opt-in\'' )
0 commit comments