From 81ea4712d150d883c58fc8c2192a555e10d42194 Mon Sep 17 00:00:00 2001 From: dharit-tan Date: Thu, 21 Jul 2022 18:54:49 +0000 Subject: [PATCH] also update user_bank_accounts table --- .../alembic/versions/ab56e2d974a6_fix_ray_account.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/discovery-provider/alembic/versions/ab56e2d974a6_fix_ray_account.py b/discovery-provider/alembic/versions/ab56e2d974a6_fix_ray_account.py index 7ef68c024ab..0c8c292c7dd 100644 --- a/discovery-provider/alembic/versions/ab56e2d974a6_fix_ray_account.py +++ b/discovery-provider/alembic/versions/ab56e2d974a6_fix_ray_account.py @@ -6,6 +6,7 @@ """ from alembic import op +from sqlalchemy.orm import sessionmaker # revision identifiers, used by Alembic. revision = 'ab56e2d974a6' @@ -13,9 +14,15 @@ branch_labels = None depends_on = None +Session = sessionmaker() def upgrade(): + bind = op.get_bind() + session = Session(bind=bind) + res = session.execute("select wallet from users where user_id = 987591") + oldWallet = res.fetchall()[0][0] op.execute("update users set wallet = '0x1111111111222222222233333333334444444444' where user_id = 987591;") + op.execute("update user_bank_accounts set ethereum_address = '0x1111111111222222222233333333334444444444' where ethereum_address = '{}';".format(oldWallet)) def downgrade():