Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair missing wallets #3656

Merged
merged 1 commit into from
Aug 8, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""repair-missing-wallets
Revision ID: 3403e008e6c7
Revises: 9931f7fd118f
Create Date: 2022-08-08 19:45:39.391707
"""
from alembic import op

# revision identifiers, used by Alembic.
revision = "3403e008e6c7"
down_revision = "9931f7fd118f"
branch_labels = None
depends_on = None


def upgrade():
conn = op.get_bind()
conn.execute(
"""
begin;
update associated_wallets
set is_delete = false
where
is_delete = true and
is_current = true and
-- July-14-2022 03:15:40 PM +-7 UTC
blocknumber > 28370000 and
-- August-08-2022 12:44:00 PM +-7 UTC
blocknumber < 28754688 and
raymondjacobson marked this conversation as resolved.
Show resolved Hide resolved
user_id in (select user_id from associated_wallets where is_delete = false);
update users
set has_collectibles = true
where
has_collectibles = false and
is_current = true and
-- July-14-2022 03:15:40 PM +-7 UTC
blocknumber > 28370000 and
-- August-08-2022 12:44:00 PM +-7 UTC
blocknumber < 28754688 and
user_id in (select user_id from users where has_collectibles = true);
raymondjacobson marked this conversation as resolved.
Show resolved Hide resolved
commit;
"""
)


def downgrade():
pass