mirror of
https://github.com/readest/readest.git
synced 2026-11-29 19:02:28 +00:00
Tooling for "please merge my two accounts" tickets, both under apps/readest-app/scripts/db and run with `node --env-file=.env --env-file=.env.local`. inspect-accounts.mjs is read-only: it resolves users by email through the GoTrue admin API and reports identities, per-table row counts, the plans row, payments, recent book titles for ownership verification, and the files rows checked against the objects actually present in R2, plus the book/file overlap between accounts. merge-accounts.mjs moves one account's cloud data into another account of the same person: server-side R2 CopyObject with a HEAD size check, re-pointing books / book_configs / book_notes / stat_* / replicas / files rows with the file_key prefix rewritten, newer-updated_at-wins on primary-key collisions, updated_at stamped on the tables whose sync pull keys on it, then plans.storage_usage_bytes recomputed on both users. Files rows with no object behind them (abandoned upload reservations) are left behind. Dry run by default; --apply writes. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| inspect-accounts.mjs | ||
| merge-accounts.mjs | ||
| verify-migration-020.sh | ||