-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migration to backfill user.pubid column part 2
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
h/migrations/versions/f29f80083c26_backfill_user_pubid_part_2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |