Documentation
¶
Overview ¶
Package postgres applies and inspects the versioned PostgreSQL schema migrations embedded from this directory (the NNNN_*.up.sql files).
Migrations are tracked in the agentflow_schema_migrations table (created by the runner up front and formally owned by migration 0004), so reruns skip versions that are already applied. Concurrent first boots are serialized with a PostgreSQL advisory lock held on a single connection for the whole run, and each migration plus its version record commits in one transaction.
Index ¶
Constants ¶
const RequiredVersion = 7
RequiredVersion is the minimum applied schema version this codebase needs. Version 4 adds agentflow_run_snapshots.fence_token, which fenced snapshot saves (runstate.FencedRepository) depend on; version 5 adds the agentflow_outbox table used by transactional event outbox writes and the framework outbox relay; version 6 adds tenant isolation to runtime events; version 7 adds tenant isolation to async jobs. ValidateWiring refuses to start against an older schema so missing columns/tables surface at boot instead of at runtime.
Variables ¶
This section is empty.
Functions ¶
func AppliedVersion ¶
AppliedVersion returns the highest recorded migration version. A database without the version table (never migrated) reports version 0 so callers can treat "no bookkeeping" as "nothing applied" instead of an error.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
apply-migrations
command
Command apply-migrations applies the embedded agentflow PostgreSQL schema migrations to the database named by AGENT_POSTGRES_DSN (or the first argument).
|
Command apply-migrations applies the embedded agentflow PostgreSQL schema migrations to the database named by AGENT_POSTGRES_DSN (or the first argument). |