From 3a1dacd6990d0af12d9b77b59cd8a3cfa6c669d2 Mon Sep 17 00:00:00 2001 From: Justin Carter Date: Tue, 28 Nov 2023 16:01:27 +0100 Subject: [PATCH] chore: re-init-withdraw-fee migration (#3614) --- .../20231128111840-re-init-withdraw-fee.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 core/api/src/migrations/20231128111840-re-init-withdraw-fee.ts diff --git a/core/api/src/migrations/20231128111840-re-init-withdraw-fee.ts b/core/api/src/migrations/20231128111840-re-init-withdraw-fee.ts new file mode 100644 index 0000000000..c74425da41 --- /dev/null +++ b/core/api/src/migrations/20231128111840-re-init-withdraw-fee.ts @@ -0,0 +1,15 @@ +module.exports = { + /* eslint @typescript-eslint/ban-ts-comment: "off" */ + // @ts-ignore-next-line no-implicit-any error + async up(db) { + console.log("Begin withdrawFee reset") + const res = await db + .collection("accounts") + .updateMany({}, { $unset: { withdrawFee: 1 } }, { multi: true }) + console.log({ res }, `resetting withdrawFee fields`) + }, + + async down() { + console.log(`rollback withdrawFee reset not needed`) + }, +}