Files
runners-calendar/docs/auth-rollout.md
2026-05-21 00:01:35 +03:00

795 B

Auth rollout

Before applying auth and ownership migrations in production:

  1. Run pg_dump for the target database and keep the dump until verification is complete.
  2. Record the rollback command for restoring that dump if migration or legacy race claiming fails.
  3. Record the current race count with SELECT count(*) FROM races;.
  4. Run migrations.
  5. After the first email-verified user claims legacy races, verify:
    • SELECT count(*) FROM races; matches the pre-migration count.
    • SELECT count(*) FROM races WHERE owner_user_id IS NULL; is 0 before planning the follow-up NOT NULL migration.

Seed/import after auth requires SEED_OWNER_USER_ID or SEED_OWNER_EMAIL once users exist. It inserts missing seed races for that owner and does not overwrite user-edited races.