You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support deployment-managed migrations instead of runtime auto-migrations #2276
EmDash currently runs pending core migrations during runtime initialization. On Cloudflare Workers/Hyperdrive, that can happen inside the first visitor request or cron event for a cold isolate.
That behavior is risky for deployed environments:
Deploys can succeed even if migrations later fail.
Visitor requests or cron events can pay migration latency.
Multiple isolates can contend on migration locks.
Schema mutations happen during request handling.
Failures surface as live request failures instead of failed CI/deployments.
Shared preview/staging databases can be mutated unexpectedly by runtime traffic.
For production-like environments, migrations should be deployment-managed:
Production: never apply migrations during request/cron lifecycle.
Staging: same as production, so it catches deploy/migration failures early.
Shared previews: same as production, especially when previews share DB state.
Local dev: auto-migration is useful, ideally before emdash dev starts rather than mid-request.
Could EmDash provide a supported CI/operator migration path and a runtime mode that does not apply migrations?
Possible shape:
emdash migrate to apply pending migrations explicitly.
emdash migrate --check to fail non-zero if migrations are pending.
auto: current behavior; applies pending migrations at runtime.
check: runtime verifies migrations are current and fails loudly if pending, without mutating schema.
manual: runtime does not check or apply migrations; CI/operator is responsible.
The default could remain auto for backward compatibility, but production/staging/shared-preview docs and templates should recommend check or manual with an explicit CI migration step.
Activity
ascorbic commentedon Aug 11, 2026
Proposal here: #2418