Upgrade and Migration Guide
0.10.x highlights
Model registration and hooks
Public helpers now include:registerModelsisModelRegisteredsetModelRegistryStrictModeisModelRegistryStrictMode
- Register all models during bootstrap.
- Keep strict mode enabled by default.
Factory concurrency semantics
Factory.createMany(..., concurrency > 1)is fail-fast.- If any worker fails, the operation rejects.
- Use
allSettled-style handling where partial success is required.
Migration safety
- Migration tracker enforces append-only history checks and checksum-style invariants.
- If rollback fails, run the rollback recovery runbook.
Production guardrails
- Destructive production commands require:
ELOQUENT_ALLOW_PROD_DESTRUCTIVE=true--force --yes
Secrets and access
- CLI logs redact secrets.
- Credentials split across:
- runtime role:
ELOQUENT_DB_ROLE=runtime - migration role:
ELOQUENT_DB_ROLE=migration
- runtime role:
Observability
- Structured logging:
ELOQUENT_LOG_FORMAT=jsonELOQUENT_LOG_LEVEL=debug|info|warn|error
NoSQL enablement
If your SQL-first project enables mongo:- Add:
MONGO_URIMONGO_DB_NAMEMONGO_TEST_URIMONGO_TEST_DB_NAME
- Keep SQL migration commands on SQL connections.
- Use explicit mongo commands:
db:seed --mongodemo:scenario --test
Upgrade checklists
Pre-upgrade
- Backup target databases.
- Confirm migration files are immutable once applied.
- Validate
.envruntime/migration role split. - Ensure CI includes production guard flags.
Post-upgrade
- Run
migrate:statusfor active connections. - Run targeted smoke and seed scenarios.
- Verify logs and audit flags.
- Verify no secret leakage in logs.
- If Mongo is enabled, run precheck + seed + scenario command paths.