Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions migration/1780993625289-RepointAccountWalletForMergeMail.js
Original file line number Diff line number Diff line change
@@ -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`);
}
};