Startup follows a strict sequence:
- Load and validate
damat.config.ts. - Create one PostgreSQL pool for the process.
- Check required system and module migrations without changing the schema.
- Initialize modules, provider bindings, links, and durable services.
- Start HTTP and/or the selected workers.
If a migration is missing, startup stops with an actionable error. For a generated app, use:
bun run db:status
bun run db:migrate
Development bun run dev performs an idempotent db:setup preflight.
Production should run one migration job before any API or worker replica starts.
PostgreSQL and Redis during startup
HTTP, modules, jobs, events, pipelines, inspection, and maintenance share the same bounded PostgreSQL pool. Do not create pools inside routes, services, or workers.
An unavailable or unauthorized Redis connection degrades durable wake-ups to PostgreSQL discovery. It does not transfer lease ownership or durable history to Redis.