Database
Upgrades
Instance-wide upgrade runs and the per-server daemon and instance steps that belong to them.
Tables in this group: stage, upgrade.
stage
One daemon or instance install on one server inside an upgrade run, advanced by the orchestrator until a terminal outcome.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
upgrade_id | uuid | yes | Parent upgrade row (on delete cascade). |
server_id | uuid | yes | Parent server row (on delete cascade). |
status | text | yes | pending/waiting/dispatched/preparing/downloading/installing/restarting/verifying/done/failed/rolled_back/needs_attention/skipped. |
unit | text | yes | daemon or instance: the package this step installs on its server. |
phase | text | yes | Which part of the run the step belongs to: colocated_daemon first, then control_plane, then fleet; checked against the run order. |
batch_index | integer | yes | Zero-based wave index within the run; steps that share an index are dispatched together. |
request_id | text | no | Cell correlation id for the in-flight install; NULL until the step is dispatched. |
attempts | integer | yes | Dispatch count for this step, starting at 0 and incremented before each retry. |
next_attempt_at | timestamp(3) with time zone | no | Earliest time a non-terminal step may be retried; NULL when no retry is scheduled. |
from_version | text | no | Version installed before this step ran; NULL when the host had none. |
to_version | text | no | Version this step installs, copied from the run target for unit. |
from_commit | text | no | Commit installed before this step ran; NULL when it was unknown. |
to_commit | text | no | Commit this step installs, copied from the run target for unit. |
status_changed_at | timestamp(3) with time zone | no | When status last changed, so a step stuck in one stage can be detected. |
error_code | text | no | Machine-readable code when the step fails, rolls back or needs attention. |
error_message | text | no | Human-readable failure text set alongside error_code. |
detail | jsonb | no | Small stage facts such as bytes fetched or an exit code; the orchestrator writes it, never a transcript. |
started_at | timestamp(3) with time zone | no | When the step was first dispatched to its server; NULL until then. |
finished_at | timestamp(3) with time zone | no | When the step reached a terminal status (done, skipped, failed, needs_attention); cleared when a retry reopens it. |
upgrade
One instance-wide upgrade run, written by the upgrade orchestrator, with at most one pending or running row.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
started_by | uuid | no | User who started a manual run; NULL for an automatic run and after that account is deleted. |
status | text | yes | Lifecycle pending, running, succeeded, partially_failed, failed or cancelled; the orchestrator advances it. |
target | jsonb | no | Pins for daemon, instance and ui: version, commit, build id, built-at time and pinned manifest URL; NULL until resolved. |
preflight | jsonb | no | Checks recorded before the first dispatch: blockers, version floors and which units this run will touch. |
source | text | yes | Who started the run: manual from the panel, auto from the scheduler, or server for a single-host request. |
channel | text | yes | Update channel the run follows (trunk, canary, rc or release), copied from the instance when the run is created. |
phase | text | no | Current wave colocated_daemon, control_plane or fleet; NULL until the orchestrator enters the first wave. |
batch_policy | jsonb | no | Snapshot of upgrade settings (auto-update, batch size and maintenance window) taken when the run starts. |
counts | jsonb | no | Terminal step totals written when the run finishes, so the summary remains after old steps are pruned. |
error | text | no | Run-level failure text when the status is failed or partially_failed; NULL on success. |
started_at | timestamp(3) with time zone | no | When the orchestrator moved the run from pending to running. |
finished_at | timestamp(3) with time zone | no | When the run reached a terminal status. |
Edit on GitHub
Last updated on