Skip to main content

Migrations

  • Optional fields — New optional fields with defaults don't require a migration; Mongoose handles them.
  • password → passwordHash — Legacy users may have a password field; the script migrate-password-to-password-hash.js normalizes them. Run it after restoring a backup (e.g. into TEST_PROD) so logins work.
  • When to run — After any restore from a backup that might contain old schema data; CI does this for the E2E baseline.

Related: Backups and restore, Models and schema