Database schema and migrations
Hatchet uses PostgreSQL to keep tenant resources, workflow definitions, live execution state, run history, audit records, durable streams, and usage data. The schema separates control data from high-volume runtime and reporting data. Ordered migrations move an existing database through compatible versions. This page is a child of Data and runtime platform and relates to Repositories, messaging, and configuration and Operational command interfaces.
Relational data model
The database has two related data planes. The control plane stores tenant resources and workflow definitions. The runtime and reporting planes store schedulable work, execution history, durable data, streams, audit records, and usage views.
Tenant and workflow resources
Tenant is the main ownership boundary for platform data. A tenant groups users and resources. A workflow points to versioned jobs and steps that describe work before a run starts. Triggers connect versions to events or schedules. Worker and action records let the platform match declared work to available workers and operators. Active workers with an operator association form the lookup set used for operator-backed work.
Controller, worker, and scheduler partition records assign tenants to live service instances. A scheduler heartbeat recreates a missing scheduler partition with the same identity, so the scheduler can keep its existing wake-up subscription while rebalancing returns tenant work to that partition.
Workflow definition data also describes how execution enters the runtime. Steps can declare batching, worker slot needs, concurrency rules, and rate-limit rules. The older control tables and newer v1_ runtime tables remain related because some reads need both the workflow definition and its runtime policy.
Tenant entitlements gate optional platform behavior at the same ownership boundary. The operator step direct-completion entitlement lets newer operator flows complete child steps through the finalize path while a disabled value preserves completion matching during a mixed-version rollout.
References: cmd/…/20240115180414_init.sql• L49-197 cmd/…/20260908090000_v1_0_152.sql• L1-11 cmd/…/20261112143742_operator_step_direct_completion_entitlement.sql• L1-9 pkg/…/tenants.sql• L402-410 pkg/…/workflows.sql• L1-78 pkg/…/workflows.sql• L325-367 pkg/…/tenant_entitlement.go• L17-78
Serverless operator resources
Serverless resources let an entitled tenant expose endpoint-backed actions without using a long-lived worker. Endpoint records keep routing and health state. Process and lease records describe live ownership so another process can take over an expired unit.
Entitlement remains the gate for endpoint use and lease claims. Endpoint events provide tenant-scoped history for health, catalog, and delivery changes without replacing the endpoint or lease rows as the source of truth.
References: cmd/…/20261014190000_v1_0_175.sql• L8-108 cmd/…/20261028120000_v1_0_183.sql• L5-36 pkg/…/serverless.sql• L6-107 pkg/…/serverless.sql• L228-355
Tenant rate limits
Rate limits are tenant-owned controls that cap usage over a time window. A step can refer to a static or dynamic tenant rate limit. This lets workflow admission and platform usage policy share one ownership boundary.
Usage charges and limit changes use one tenant-scoped transaction boundary. Pause state remains separate so a limit update cannot clear a pause while work is held. Paused tasks retain the time at which they can return to normal admission.
References: sql/…/v0.sql• L363-370 sql/…/v0.sql• L492-498 cmd/…/20261022120000_v1_0_178.sql• L3-48 pkg/…/rate_limits.sql• L20-55 pkg/…/rate_limits.sql• L88-212 pkg/…/rate_limit.go• L75-135
Identity and audit records
Identity records keep user login data and tenant membership separate from workflow state. Passwords, OAuth records, sessions, API tokens, and tenant roles support access to tenant resources. Audit records add a tenant-scoped history of resource actions. They identify the actor, resource, request correlation, and client context without becoming the resource's source of truth.
Audit history uses time-based storage so old records can be retained, archived, or removed without moving active resource rows. The model supports both user and API-key actors. API tokens can also carry a read-only scope.
References: pkg/…/users.sql• L1-40 pkg/…/users.sql• L124-200 cmd/…/20261029120000_v1_0_184.sql• L1-5 cmd/…/20261031170000_v1_0_187.sql• L3-25 pkg/…/olap.sql• L232-318
Runtime state and scheduling
Runtime tables turn a workflow definition into schedulable work. A task carries its tenant, workflow, step, retry, payload, and parent-child identity. Queue, batch, pause, retry, concurrency, and worker-slot records control when that task can run. Assignment and acknowledgement state separates delivery from confirmed receipt.
The runtime keeps enough state to support retries, cancellation, pausing, batching, and recovery. Compound task keys include the insertion time. This keeps identity stable across partitions and lets lookup records find the correct attempt. External task IDs resolve through the lookup table to this paired key before reads across partitioned task and event data.
Idempotency keys provide tenant-scoped admission protection for requests that must not create a second active task. A claim succeeds for a new or expired key and remains tied to the claimed external ID until the task reaches a terminal state or the key expires.
Queue activity is also persisted separately from queued items. The platform uses the most recent queue activity to find live queues and can reactivate a stale queue when pending work remains. This keeps queue discovery aligned with the work that still needs service.
Time-based partitions keep high-volume task, event, payload, durable-log, and relationship data manageable. Partition maintenance creates upcoming ranges and removes old ranges after retention permits it.
References: sql/…/v1-core.sql• L229-336 sql/…/v1-core.sql• L423-604 pkg/…/idempotency-keys.sql• L1-99 pkg/…/tasks.sql• L1-55 pkg/…/queue.sql• L103-130 pkg/…/queue.sql• L1196-1216 cmd/…/20261117220000_add_queue_last_active_index.sql• L1-10 pkg/…/ticker.sql• L96-254
Durable execution and payloads
Durable execution stores a task's progress as an event log. The log supports replay after a worker or service interruption. Branch points and child outcomes preserve the relationship between a parent run and work that it creates.
The event log keeps invocation progress and satisfaction order with each durable task. Replay can create a new branch and compact the order of retained entries so a parent does not wait for an order that the new branch cannot produce. Child completion updates the matching durable entry while preserving tenant and task identity.
Pending match records represent waits for events or child-task completion. When a child completion can no longer satisfy a durable wait, the persistence boundary removes the match and its conditions together so the parent does not keep a stranded wait.
Payloads can stay inline or move to an external payload store. A database reference keeps either form readable through the same repository contract. This keeps large input, output, and event data out of the main state rows while preserving tenant and time-based lookup.
References: sql/…/v1-core.sql• L2167-2215 sql/…/v1-core.sql• L2524-2598 pkg/…/durable_event_log.sql• L1-70 pkg/…/durable_event_log.sql• L131-245 pkg/…/durable_event_log.sql• L333-425 pkg/…/payload-store.sql• L1-238 pkg/…/matches.sql• L298-325
Durable streams
Durable streams provide tenant-scoped append and read storage for ordered messages. A stream topic names a namespace and topic. The topic tracks offsets and the start point for new subscribers. A producer cursor tracks the last accepted sequence for each producer.
Publishing reserves topic offsets and accepts a message only when its producer sequence continues the producer watermark. Large payloads can be uploaded before publish and referenced by the message. Readers resume by topic offset and use a byte limit to keep each page bounded. A topic reset changes where subscribers without a cursor begin.
Stream data also supports usage reporting. The OLAP side records per-tenant published and delivered bytes in minute buckets. Concurrent flushes add to the same tenant bucket, while OLAP partition maintenance creates and removes the required daily ranges.
References: cmd/…/20261002182802_v1_0_160_durable_streams.sql• L3-119 cmd/…/20261005120000_v1_0_161_stream_large_payload.sql• L3-25 cmd/…/20261105230000_add_stream_bytes_aggregate.sql• L1-15 pkg/…/streams.sql• L36-174 pkg/…/streams.sql• L176-290 pkg/…/streams.go• L163-208 pkg/…/olap_stream_bytes.go• L13-49
Analytical records and aggregates
The OLAP schema is the reporting view of execution. It keeps task, DAG, run, event, status, lookup, trace, and payload records in forms suited to history, list, alert, and metric queries. Status processing turns incoming task events into current task and DAG views.
Run rows keep terminal completion time so failure and duration queries can use a stable time field. Minute aggregates compact task statuses, task events, platform events, and durable stream bytes. Reporting can combine compacted aggregates with direct run data until aggregate coverage is complete.
OLAP records use daily, weekly, monthly, or hash partitions based on access and retention needs. The same maintenance path creates the current and next ranges, removes expired ranges, refreshes statistics, and repairs parent indexes when all child indexes are ready.
References: sql/…/v1-olap.sql• L196-411 cmd/…/20261027194324_v1_0_182_olap_aggregates.sql• L4-266 cmd/…/20261102130000_v1_0_189.sql• L4-193 cmd/…/20261105230000_add_stream_bytes_aggregate.sql• L1-15 pkg/…/olap.sql• L1-27 pkg/…/olap.sql• L34-128 pkg/…/olap.sql• L187-230 pkg/…/olap.sql• L910-1168 pkg/…/olap.sql• L2710-2720
Schema sources and access boundary
Checked-in schema inputs describe the database shape used by SQL code generation. Named SQL queries form the access boundary for services. The live migration history remains the source that changes an actual database.
Canonical schema inputs
sql/…/v0.sql defines the older platform model. sql/…/v1-core.sql defines operational state and its functions, triggers, constraints, and partitions. sql/…/v1-olap.sql defines execution history and reporting state. Supporting schema stubs describe database objects that query generation must understand.
These files are not a second migration history. They describe the current shape needed to validate queries and generate types. The migration directory is the ordered history that brings a live database to that shape.
References: pkg/…/sqlc.yaml• L1-54 sql/…/v0.sql• L850-889 sql/…/v1-core.sql• L1-194 sql/…/v1-olap.sql• L1-194
Partition index maintenance
Partitioned tables use a parent index and a matching index on each partition. Maintenance repairs a parent only when every existing child index is valid. This keeps repair work from creating a parent contract that the partitions cannot support.
References: pkg/…/maintenance.sql• L1-32 pkg/…/task.go• L410-443
Repository query boundary
SQLC reads the schema inputs and named query files to generate typed Go accessors. Query groups cover tenant and partition ownership, workflow definitions, runtime state, matching state, payloads, durable logs, streams, serverless resources, audit history, OLAP data, and partition maintenance. Tenant IDs and compound task keys travel through the queries that touch tenant state.
The generated models are part of the database contract. A change to a column, enum, function, or key must keep the migration, schema input, SQL query, and generated result shape aligned. Shared database enums and special array or UUID mappings also need to keep their Go types aligned with the schema.
References: pkg/…/sqlc.yaml• L7-89 pkg/…/sqlc.yaml• L170-198 pkg/…/models.go• L952-991 pkg/…/matches.sql• L1-325 pkg/…/olap.sql• L1-27 pkg/…/streams.sql• L1-321 pkg/…/tenants.sql• L1-126
Migration lifecycle
Migrations are ordered changes that bring PostgreSQL from an earlier state to the current state. The migration command applies them under a database session lock so multiple service instances do not change the schema at the same time.
Migration history
The cmd/hatchet-migrate/migrate/migrations directory contains timestamped SQL migrations and registered Go migrations. SQL migrations use Goose up and down sections. The binary embeds the SQL files. Go migrations cover changes that need program logic.
Recent migrations add durable streams, large stream payloads, serverless resources, payload references, rate-limit pause state, partitioned runtime and OLAP data, audit records, run completion times, failure indexes, minute aggregates, a shorter default idle lifetime for sandbox providers, a partial lookup index for active workers assigned to operators, an operator step direct-completion entitlement, and queue activity lookup. The stream usage addition creates a tenant-and-minute table for published and delivered byte totals. It also joins the normal OLAP partition lifecycle through the named partition queries. The operator entitlement migration adds a tenant-scoped boolean with a false default and removes it on rollback.
The retry queue trigger restores eligible queued work after a retry row is removed. It now exits when the deletion set is empty, which keeps cleanup statements from doing work when no retry rows were deleted. The queue activity index is created and removed concurrently so live queue reads do not require a long table lock.
Some migrations run outside a transaction because PostgreSQL requires that for concurrent index work or controlled partition changes. The queue activity index uses this mode. The tool also runs the pgoutbox migration set before the main Goose set.
References: cmd/…/run.go• L16-28 cmd/…/run.go• L269-279 cmd/…/20261117220000_add_queue_last_active_index.sql• L1-10 cmd/…/20261119161909_retry_queue_delete_trigger_skip_empty.sql• L1-10 cmd/…/20261119161909_retry_queue_delete_trigger_skip_empty.sql• L11-152 cmd/…/20261027194324_v1_0_182_olap_aggregates.sql• L1-103 cmd/…/20261102130000_v1_0_189.sql• L1-193
Migration command behavior
hatchet-migrate reads DATABASE_URL unless its migration library caller supplies another URL. It opens PostgreSQL with a short retry window, takes a PostgreSQL session lock, and checks the Goose version table before applying pending migrations.
The command supports these paths:
- No version flag: apply all pending migrations.
--up-to <version>: apply migrations through the given Goose version.--up-to-penultimate: apply through the second-to-last embedded migration.--down <version>: move down to a target version after checking the target is not newer than the current version.--version: print the command version and exit.
If the Goose table does not exist, the command creates it. It can also recognize earlier Atlas or Prisma migration records and mark matching embedded migrations as applied. This lets an older database join the Goose history without replaying its old schema creation steps.
References: cmd/…/main.go• L19-91 cmd/…/run.go• L60-167 cmd/…/run.go• L213-306 cmd/…/run.go• L393-511
Compatibility transitions
Some migrations support a staged deployment. A compatibility migration can add a new table or trigger that mirrors an older write path. Services can then move to the new model while both paths remain consistent during a mixed-version release.
This pattern matters for a live workflow system because workers and API instances can run different releases during deployment. Nullable additions and preserved legacy partitions let old rows remain readable while new writers use the new contract.
References: cmd/…/20260216000001_v1_0_79_a_multi_slot_schema_and_triggers.sql• L6-183 cmd/…/20261007165555_v1_0_164.sql• L233-673 cmd/…/20261008173835_v1_0_168.sql• L44-579 sql/…/v1-core.sql• L300-336
Persistence flows
The main persistence flows connect tenant definitions to execution, history, stream data, usage views, and audit records. The database keeps each flow tenant-scoped while using shared partition and retention rules for high-volume data.
Workflow definition flow
This flow shows how a tenant-owned workflow becomes executable state.
flowchart LR
Tenant[Tenant] --> Workflow[Workflow]
Workflow --> Version[Workflow version]
Version --> Job[Job]
Job --> Step[Step]
Version --> Trigger[Event or schedule trigger]
Step --> Policy[Concurrency, batch, and slot policy]
Step --> Action[Action]
Action --> Worker[Worker capability]
Workflow and version records provide stable identity. Jobs and steps add the work shape. Triggers and policies add the conditions that let the runtime create, group, admit, and control execution.
References: cmd/…/20240115180414_init.sql• L49-197 pkg/…/workflows.sql• L95-215 pkg/…/workflows.sql• L261-367
Task execution flow
This flow shows how a runtime request moves through durable state and history.
flowchart LR
Trigger[Trigger or API request] --> Task[Task or DAG]
Task --> Dedup[Tenant idempotency key]
Dedup --> Queue[Queue item]
Queue --> Admission[Batch, pause, or concurrency admission]
Admission --> Runtime[Task runtime assignment]
Runtime --> Worker[Worker]
Worker --> Event[Task event and status]
Event --> History[OLAP run history]
Event --> Durable[Durable event log]
Durable --> Match[Pending durable wait]
Child[Child task completion] --> Match
Task --> Payload[Inline or referenced payload]
Retry[Retry timer] --> Admission
The task row links scheduling, worker execution, and history. Idempotency state prevents a duplicate active request from entering this path. Admission rows control when work can run. Events and durable logs preserve what happened. Pending matches connect durable waits to later event or child outcomes. OLAP rows make the result available for history, alerts, and analysis.
References: sql/…/v1-core.sql• L423-596 pkg/…/idempotency-keys.sql• L8-99 pkg/…/tasks.sql• L386-481 pkg/…/queue.sql• L324-490 pkg/…/durable_event_log.sql• L167-245 pkg/…/matches.sql• L246-325 pkg/…/olap.sql• L910-1168
Durable stream flow
This flow shows how an entitled tenant publishes ordered messages and produces usage totals.
flowchart LR
Entitlement[Tenant entitlement] --> Topic[Stream topic]
Producer[Producer sequence] --> Cursor[Producer cursor]
Topic --> Offset[Reserved topic offset]
Cursor --> Message[Ordered stream message]
Offset --> Message
Upload[Large payload upload] --> Payload[Stream payload]
Payload --> Message
Message --> Reader[Cursor and byte-limited reader]
Message --> Usage[Published and delivered byte totals]
Usage --> Minute[Minute usage aggregate]
Retention[Retention limit] --> Cleanup[Topic and partition cleanup]
Cleanup --> Message
Cleanup --> Payload
The topic and producer cursor coordinate publish order. A large payload can use a separate tenant-scoped row before the message points to it. The usage aggregate records byte totals by tenant and minute. Stream message and payload retention remain separate from aggregate retention.
References: pkg/…/streams.sql• L36-115 pkg/…/streams.sql• L153-198 pkg/…/olap.sql• L1-27 pkg/…/olap_stream_bytes.go• L13-49 cmd/…/20261105230000_add_stream_bytes_aggregate.sql• L1-15
Change checklist
When these files or sections are changed, remember to consider these:
- A change to a v1 task or DAG key must preserve the matching inserted-time columns in lookup, queue, runtime, event, durable-log, and OLAP tables.
- External-ID task resolution must preserve the lookup table's
(task_id, inserted_at)pair and the partition bounds used by task, DAG, event, and durable-log reads. - A new enum value or status rule must stay aligned between core, OLAP, migration SQL, and generated query types.
- A change to a partitioned table must preserve partition creation and cleanup queries for both the parent table and its high-volume dependents.
- Queue activity changes must keep
last_active, the live-queue cutoff, reactivation of queues with pending work, and the concurrent(tenant_id, last_active)index aligned. - Retry queue trigger changes must preserve the distinction between a real deleted retry row and an empty deletion set. Eligible queued tasks must still return to either a concurrency slot or a normal queue item.
- Idempotency changes must preserve tenant-and-key uniqueness, expiry-based reclaim, claimed external IDs, and terminal-task release behavior.
- Durable event-log changes must preserve branch identity, satisfaction order, invocation progress, tenant scope, and stable lock order for batched updates.
- A change to serverless endpoint state must preserve entitlement checks, endpoint ownership, process expiry, lease takeover, and routing refresh behavior.
- A rate-limit change must preserve tenant and key uniqueness, refill behavior, pause state, step references, and the transaction lock used by the rate-limit repository.
- A compatibility table or trigger change must cover both the old write path and the new repository query path during mixed-version deployment.
- A schema function used by SQLC must update the matching stub or schema definition so code generation sees the same function contract.
- A migration that creates an index concurrently or runs outside a transaction must retain the migration's required deployment conditions.
- A payload or durable-log change must preserve the external-ID lookup contract, UUID time lookup, and tenant scope used by repository queries.
- A durable child-task completion cleanup must delete the match and its conditions together while preserving tenant and durable-task identity.
- A durable stream change must keep entitlement, resource limits, topic offsets, producer sequence checks, starting offsets, and generated result types aligned.
- Concurrent stream or usage flushes must keep their stable tenant lock order so separate flushes do not deadlock.
- A change to stream retention must account for tenant-level deletion, shared hourly message and payload partition deletion, and the longest tenant retention.
- A change to OLAP aggregate coverage must keep the completion watermark and raw-data fallback aligned with the aggregate triggers.
- A change to the OLAP run index must preserve the no-transaction drop and concurrent rebuild path used for safe rollback.
- A change to partition cleanup helpers must keep date boundary semantics aligned for daily, weekly, and monthly callers.
- A task assignment or acknowledgement change must keep
assigned_at,acked_at, reassignment behavior, and the tenant-scoped unacknowledged index aligned. - A sandbox provider default change must keep new-row behavior aligned between the live migration and the canonical schema input.
- A tenant entitlement change must keep the migration, canonical table shape, entitlement names, repository upsert, and generated model aligned. Preserve a safe default for mixed-version deployments.
- Scheduler partition heartbeat changes must preserve the partition ID used by the scheduler subscription. A missing stale row must be recreated under that same ID before tenant rebalancing.
- SQLC generated files must be regenerated after an idempotency, durable-log, queue, task, stream, entitlement, OLAP, or tenant partition query change.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
DATABASE_URL is missing or points to an unavailable PostgreSQL server | Migration stops before schema changes are applied | Set a valid database URL and use the command's connection retry and diagnostic output |
| Two migration processes run without the session lock | DDL or version records can race and leave the database at an unclear version | Run migrations through hatchet-migrate, which takes a PostgreSQL session lock |
| A required runtime or OLAP partition is absent | New tasks, events, payloads, stream usage rows, or history rows cannot be inserted for the affected range | Run partition creation operations before the next range starts |
| The queue activity index migration runs in a transaction | PostgreSQL rejects the concurrent index operation | Keep 20261117220000_add_queue_last_active_index.sql as a no-transaction migration |
| Queue activity is not updated or a stale queue with pending items is not reactivated | Queue discovery can miss work that still needs a worker | Update last_active on queue use and run the pending-item reactivation path |
The retry delete trigger processes an empty deleted_rows set | Cleanup can perform unnecessary work or fail to produce the expected trigger result | Return immediately when no retry rows were deleted |
| An idempotency claim ignores tenant scope or expiry | One tenant can block another or a request can be accepted twice | Lock keys by (tenant_id, key) and reclaim only expired keys |
A new task lookup omits inserted_at | Reads can select the wrong partitioned task or fail to find a retry record | Carry the task ID and insertion time together through lookup and repository queries |
| Durable satisfaction order is not compacted after a branch change | Replay can wait forever for an order that the live branch cannot produce | Renumber retained satisfied entries before replay |
| A child-task completion match is not removed with its conditions | A durable parent can keep waiting on a child outcome that can no longer arrive | Delete the matching v1_match row and its v1_match_condition rows in one cleanup path |
| The stream byte aggregate migration is missing | Usage flushes fail because their target table does not exist | Apply 20261105230000_add_stream_bytes_aggregate.sql before enabling stream usage writes |
| OLAP partition creation omits the stream byte aggregate | A new minute bucket cannot accept usage after the date changes | Keep the aggregate in the create and cleanup partition query lists |
| Concurrent usage flushes use different tenant orders | Flushes can wait on each other or deadlock | Sort tenant rows before the additive upsert |
| A stream producer publishes a duplicate or out-of-order sequence | The message is not inserted and the caller must distinguish a duplicate from a sequence gap | Use the producer watermark result and retry only with the expected next sequence |
| A shared stream partition is removed before the longest tenant retention expires | A tenant can lose messages or payloads that its retention setting still promises | Compute shared maximum retention before dropping a message or payload partition |
| A large stream publish stores a message without a resolvable payload reference | The reader returns missing data for a message that was accepted | Set both payload reference fields in the publish transaction |
| A worker operator index is built in a transaction | PostgreSQL rejects the concurrent index operation or blocks normal writes longer than intended | Keep the migration marked NO TRANSACTION and use concurrent create and drop operations |
| The operator step entitlement column is used before its migration is applied | Entitlement reads and full upserts fail because the database shape is older than the generated query contract | Apply 20261112143742_operator_step_direct_completion_entitlement.sql before using the new entitlement contract |
| A scheduler heartbeat creates a new partition ID after the old row is removed | The scheduler keeps listening to the old topic and does not receive work rebalanced to the new row | Recreate the missing row with the scheduler's existing ID and update only its heartbeat |
| SQLC generated files are stale after a query or schema change | Service code can scan columns into the wrong result shape or fail to compile | Regenerate typed accessors from the matching query and schema inputs |
Key files
| File | Why to read it |
|---|---|
| sql/…/v1-core.sql | Main operational schema for workflow execution, queues, concurrency, payloads, events, durable logs, partitions, maintenance settings, and tenant entitlements |
| sql/…/v1-olap.sql | Reporting schema for execution history, payload references, aggregates, partitions, and status updates |
| sql/…/v0.sql | Older platform schema that remains part of the SQLC schema inputs |
| pkg/…/sqlc.yaml | Mapping between schema inputs, named SQL queries, and generated Go accessors |
| pkg/…/tenants.sql | Tenant ownership, partition assignment, scheduler heartbeat recovery, membership, alerting, and tenant usage queries |
| pkg/…/workflows.sql | Persistence boundary for workflow definitions and execution policies |
| pkg/…/tasks.sql and pkg/…/tasks-overwrite.go | Task identity, external-ID lookup, retry, replay, payload references, runtime state, activity checks, and partition lifecycle operations |
| pkg/…/queue.sql | Queue activity, selection, batching, pause movement, worker assignment, cancellation, reactivation, and retry movement |
| pkg/…/idempotency-keys.sql | Tenant-scoped request claims, expiry reclaim, and terminal-task release |
| pkg/…/durable_event_log.sql | Durable task progress, branch replay, satisfaction order, child outcomes, and invocation state |
| pkg/…/matches.sql | Durable wait matching, child-completion cleanup, and event condition state |
| pkg/…/streams.sql | Stream topics, ordering, payload references, byte-limited reads, reset, retention, and stream partitions |
| pkg/…/streams.go | Tenant-facing stream persistence contract and transaction flow |
| pkg/…/olap.sql | OLAP partition maintenance, history access, status views, aggregate writes, audit records, and stream byte upserts |
| pkg/…/olap.go | OLAP repository boundary and shared partition lifecycle |
| pkg/…/olap_stream_bytes.go | Tenant stream byte flush contract and concurrent aggregation behavior |
| cmd/…/20261117220000_add_queue_last_active_index.sql | Concurrent index migration for tenant queue activity lookup |
| cmd/…/20261119161909_retry_queue_delete_trigger_skip_empty.sql | Retry queue trigger behavior when deletion has no rows and when eligible work must be restored |
| cmd/…/main.go | User-facing migration flags and command dispatch |
| cmd/…/run.go | Database connection, baseline handling, locking, Goose execution, and down migration behavior |