@@ -16,7 +16,7 @@ test('When we use the fastify-postgres transaction route option', t => {
16
16
connectionString
17
17
} )
18
18
19
- await fastify . pg . query ( 'TRUNCATE users' )
19
+ await fastify . pg . query ( 'DELETE FROM " users" WHERE TRUE ' )
20
20
21
21
fastify . get ( '/count-users' , async ( req , reply ) => {
22
22
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 => {
49
49
name : 'test'
50
50
} )
51
51
52
- await fastify . pg . test . query ( 'TRUNCATE users' )
52
+ await fastify . pg . test . query ( 'DELETE FROM " users" WHERE TRUE ' )
53
53
54
54
fastify . get ( '/count-users' , async ( req , reply ) => {
55
55
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 => {
82
82
connectionString
83
83
} )
84
84
85
- await fastify . pg . query ( 'TRUNCATE users' )
85
+ await fastify . pg . query ( 'DELETE FROM " users" WHERE TRUE ' )
86
86
87
87
fastify . get ( '/count-users' , async ( req , reply ) => {
88
88
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 => {
117
117
name : 'test'
118
118
} )
119
119
120
- await fastify . pg . test . query ( 'TRUNCATE users' )
120
+ await fastify . pg . test . query ( 'DELETE FROM " users" WHERE TRUE ' )
121
121
122
122
fastify . get ( '/count-users' , async ( req , reply ) => {
123
123
const result = await fastify . pg . test . query ( 'SELECT COUNT(*) AS "userCount" FROM users WHERE username=\'fail-opt-in\'' )
0 commit comments