From e6a8b068166ce001c2a988d734045fb584e5a4c7 Mon Sep 17 00:00:00 2001 From: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:35:19 +0200 Subject: [PATCH] Repoint account primary wallet so merge mail is delivered --- ...625289-RepointAccountWalletForMergeMail.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 migration/1780993625289-RepointAccountWalletForMergeMail.js diff --git a/migration/1780993625289-RepointAccountWalletForMergeMail.js b/migration/1780993625289-RepointAccountWalletForMergeMail.js new file mode 100644 index 0000000000..86cb1583db --- /dev/null +++ b/migration/1780993625289-RepointAccountWalletForMergeMail.js @@ -0,0 +1,29 @@ +// Re-point userData 307373's primary wallet from "Edge" (id 67) to the default +// "DFX Wallet" (id 1). The Edge wallet disables the "Info" mail type via mailConfig, +// which silently suppresses the ACCOUNT_MERGE_REQUEST mail (classified as Info), so the +// pending account merge can never be confirmed. Re-pointing to a wallet without an Info +// opt-out lets the merge confirmation mail be delivered. +// +// Env-guarded: only the PROD row matches; on other environments this is a no-op. +// Verified on 2026-06-09: 307373."walletId" = 67, target wallet 1 has mailConfig = NULL. +module.exports = class RepointAccountWalletForMergeMail1780993625289 { + name = 'RepointAccountWalletForMergeMail1780993625289'; + + async up(queryRunner) { + const accounts = await queryRunner.query( + `SELECT "id" FROM "user_data" WHERE "id" = 307373 AND "walletId" = 67`, + ); + if (!accounts.length) return; + + await queryRunner.query(`UPDATE "user_data" SET "walletId" = 1 WHERE "id" = 307373`); + } + + async down(queryRunner) { + const accounts = await queryRunner.query( + `SELECT "id" FROM "user_data" WHERE "id" = 307373 AND "walletId" = 1`, + ); + if (!accounts.length) return; + + await queryRunner.query(`UPDATE "user_data" SET "walletId" = 67 WHERE "id" = 307373`); + } +};