Documentation
¶
Overview ¶
migrate is the consolidated one-off maintenance tool for an Ex DynamoDB table. Each subcommand is an idempotent, resumable backfill or cleanup that can be re-run any number of times without harm. All default to --dry-run; pass --apply to actually write.
Usage:
go run ./cmd/migrate <subcommand> [--apply] [-v]
Subcommands:
thread-delete soft-delete replies whose thread root is already deleted
thread-index backfill the GSI1 thread index on existing replies
parent-index backfill per-parent PIN#/FILE# index rows
notification-keywords seed name keywords for accounts that have none, and
swap a seeded "Muhammad" prefix for the name after it
attachment-relink re-link orphaned attachments to their message [--window=1h]
draft-cleanup delete orphaned DynamoDB DRAFT# rows (drafts now live in Redis)
evt-ttl set the idle TTL on legacy durable inbox streams (Redis)
search-reindex recreate ex_users/ex_channels with the autocomplete mapping + reindex (OpenSearch)
avatar-resize shrink avatars stored before uploads were resized (S3 + Redis)
thumbnail-webp re-encode lossless WebP message thumbnails as lossy WebP (S3) [--workers=16]
oidc-unbind clear an account's pinned SSO identity so its next SSO login re-pins it --email=<address>
thread-activity order existing followed threads by latest reply for the paged /threads list
Required environment variables (same as the `ex` server):
- AWS_REGION
- DYNAMODB_TABLE
- DYNAMODB_ENDPOINT (only for DynamoDB Local)
- OPENSEARCH_URL (only for the search-reindex subcommand)
- S3_* (only for avatar-resize and thumbnail-webp) and REDIS_URL (only for evt-ttl and avatar-resize)