Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 2ce9816

Browse files
Fix issue where migration script copied data from db before it could delete existing data in ES
1 parent 0b0a677 commit 2ce9816

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

scripts/db/dumpDbToEs.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ const {
1111

1212
async function cleanupES () {
1313
const client = getESClient()
14-
client.indices.delete({
14+
15+
await client.indices.delete({
1516
index: '_all'
16-
}, function (err, res) {
17-
if (err) {
18-
console.error(err.message)
19-
} else {
20-
console.log('Existing indices have been deleted!')
21-
}
2217
})
18+
19+
console.log('Existing indices have been deleted!')
2320
}
2421

2522
async function insertIntoES (modelName, body) {

0 commit comments

Comments
 (0)