@@ -209,7 +209,7 @@ extension DatabasePool.Database {
209
209
try await _withDatabase ( " postgres " , details: connectionDetails, timeout: . seconds( 10 ) ) { // Connect to `postgres` db in order to reset the test db
210
210
let databaseName = Environment . get ( " DATABASE_NAME " ) !
211
211
try await $0. query ( PostgresQuery ( unsafeSQL: " DROP DATABASE IF EXISTS \( databaseName) WITH (FORCE) " ) )
212
- try await $0. query ( PostgresQuery ( unsafeSQL: " CREATE DATABASE \( databaseName) " ) )
212
+ try await $0. query ( PostgresQuery ( unsafeSQL: " CREATE DATABASE \( databaseName) STRATEGY = file_copy " ) )
213
213
}
214
214
215
215
do { // Use autoMigrate to spin up the schema
@@ -231,7 +231,7 @@ extension DatabasePool.Database {
231
231
do {
232
232
try await _withDatabase ( " postgres " , details: connectionDetails, timeout: . seconds( 10 ) ) { client in
233
233
try await client. query ( PostgresQuery ( unsafeSQL: " DROP DATABASE IF EXISTS \( snapshot) WITH (FORCE) " ) )
234
- try await client. query ( PostgresQuery ( unsafeSQL: " CREATE DATABASE \( snapshot) TEMPLATE \( original) " ) )
234
+ try await client. query ( PostgresQuery ( unsafeSQL: " CREATE DATABASE \( snapshot) TEMPLATE \( original) STRATEGY = file_copy " ) )
235
235
}
236
236
} catch {
237
237
print ( " Create snapshot failed with error: " , String ( reflecting: error) )
@@ -246,7 +246,7 @@ extension DatabasePool.Database {
246
246
do {
247
247
try await _withDatabase ( " postgres " , details: details, timeout: . seconds( 10 ) ) { client in
248
248
try await client. query ( PostgresQuery ( unsafeSQL: " DROP DATABASE IF EXISTS \( original) WITH (FORCE) " ) )
249
- try await client. query ( PostgresQuery ( unsafeSQL: " CREATE DATABASE \( original) TEMPLATE \( snapshot) " ) )
249
+ try await client. query ( PostgresQuery ( unsafeSQL: " CREATE DATABASE \( original) TEMPLATE \( snapshot) STRATEGY = file_copy " ) )
250
250
}
251
251
} catch {
252
252
print ( " Restore snapshot failed with error: " , String ( reflecting: error) )
0 commit comments