Skip to content

Commit

Permalink
Add migration to backfill user.pubid column part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mtomilov committed Jan 15, 2025
1 parent 20e3048 commit f396b55
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions h/migrations/versions/f29f80083c26_backfill_user_pubid_part_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Backfill user.pubid with unique values part 2."""

from alembic import op

from h.migrations.versions.f32200e2e496_backfill_user_pubid import backfill_users

revision = "f29f80083c26"
down_revision = "f32200e2e496"

USER_PUBID_LENGTH = 12
USER_BATCH_LIMIT = 1000
USER_MAX_COUNT = 100_000_000
USER_PUBID_RETRIES = 5


def upgrade():
session = op.get_bind()

backfill_users(
session,
USER_BATCH_LIMIT,
USER_MAX_COUNT,
USER_PUBID_RETRIES,
USER_PUBID_LENGTH,
)


def downgrade():
pass

0 comments on commit f396b55

Please sign in to comment.