Upgrading¶
GoHead follows semantic versioning. Before 1.0, minor versions (0.4 → 0.5) can contain breaking changes; each one is listed below and in the changelog. From 1.0, breaking changes to the public API only come with a new major version.
How to upgrade¶
- Back up the database (and the uploads if they are on local disk). Database migrations cannot always be undone; a backup always can.
- Read the notes for every version between yours and the target, below.
- You can skip versions: migrations apply in order from wherever your database is.
-
Deploy the new version:
-
Check
gohead migrate status, the API's/_health, and the admin UI.
Database migrations¶
The schema is versioned. Each migration runs once, in order, and is recorded in the
schema_migrations table. Migrations are serialized by a database lock (PostgreSQL
advisory lock, MySQL GET_LOCK), so several replicas or init containers can start at the
same time.
| How | When to use it |
|---|---|
auto_migrate: true (default) |
The API applies pending migrations when it starts. Fine for a single instance or Compose. |
gohead migrate, then the API with auto_migrate: false |
Kubernetes and any setup where the schema should change in one controlled step. The Helm chart does this in an init container. With auto_migrate: false, the API refuses to start on an outdated schema. |
gohead migrate status # what ran, what is pending
gohead migrate # apply pending migrations
gohead migrate down # revert the last one, when it can be undone
The lock is a session lock: with PgBouncer in transaction pooling mode, point
gohead migrate at PostgreSQL directly (or a session-mode pool), or a stuck lock can make
later runs wait for 10 minutes. On SQLite there is no lock: run migrations from one
process (the API itself, or gohead migrate while the API is stopped).
0001_baseline creates the schema on a new database, and brings a database created by an
earlier version (which migrated automatically from the models) up to date. Later
migrations are explicit, reviewed steps; contributors add them in pkg/migrations.
Version notes¶
0.8.0¶
- Migration
0008_user_ssoadds two columns tousers(the identity provider an account signs in with). It runs when the API starts; withauto_migrate: false, rungohead migratefirst. - Sign in with Google is off until you set
auth.sso.google.client_idandclient_secret: see Sign in with Google. Setauth.sso.public_urlin production. - Demo mode (
demo.enabled) is off by default; nothing changes for other instances. See Public demo. - Render: the Dockerfile now follows 0.8.x. A service deployed from your own copy of the
repository keeps its version: set
GOHEAD_VERSION=0.8and deploy.
0.7.0¶
- Migration
0007_connectionsadds the table of connected apps. It runs when the API starts; withauto_migrate: false, rungohead migratefirst. - Connected apps' tokens are encrypted with a key derived from
jwt_secret. Setjwt_secret(GOHEAD_JWT_SECRET) to the same value in every process (API, workers); without it, tokens are stored unencrypted. Changingjwt_secretlater means entering the tokens again. - Agents in the short
toolsform. Agents saved withfunctionskeep working, and responses now return bothtoolsandfunctions. Agents naming a tool that doesn't exist are refused when saved. - API: proposals can have
"action": "call"(a call to a connected app's tool,"collection": "app:<connection>"). Only admins in a user session see them: clients listing proposals with an editor's or an API token's credentials get none. Clients that checkactionagainst a fixed list should acceptcall.
0.6.3¶
No migration and nothing to change. Agents on Anthropic call their functions again: on 0.6.2 and earlier, a run often ended after Claude's first sentence. GoHead can also be deployed to Render in one click.
0.6.2¶
No migration and nothing to change. The admin UI moves to Chakra UI v3, with the same
screens and behaviour. On a Mac, GoHead also installs with Homebrew
(brew install gohead-cms/tap/gohead).
0.6.1¶
A bug fix release, with no migration and nothing to change: public access works again
with rate limiting on (the default). On 0.6.0, anonymous reads of public types answered
401; if you turned rate limiting off to work around it, you can turn it back on.
0.6.0¶
Breaking changes
- The admin UI is served by the API. Binaries and the
goheadimage include it, andgohead startserves it at/.GETrequests to other paths outside the API (/api,/admin,/auth,/uploads,/_health,/_metrics) now return the UI instead of404. To keep an API-only host (the UI served bygohead-admin, say), setui.enabled: false(GOHEAD_UI_ENABLED=false). - SQLite uses a pure-Go driver. Existing databases open as they are (same time format)
and are switched to WAL mode: back up the
-waland-shmfiles with the database, or usesqlite3 gohead.db ".backup …". Parameters of the former driver insqlite://URLs (_busy_timeout,_foreign_keys,_loc…) are ignored: use?_pragma=busy_timeout(5000)-style parameters.
Migration 0006_jobs adds the jobs table of the database job queue.
Nothing changes for installs on Redis: redis stays the default queue of gohead start,
worker, dispatcher and scheduler.
The gohead image is now static (distroless/static, no cgo); it still runs as user
65532 with data in /data. An agent is no longer triggered by content events caused by
its own changes.
To move a small install to gohead standalone: stop the API, worker,
dispatcher and scheduler, let Redis's queues drain first, then run gohead standalone with
the same configuration and queue.driver: database.
Migration 0004_agent_reviews adds the proposals table and two columns (agents.require_approval,
agent_runs.dry_run). Existing agents keep writing directly. Nothing to do.
Migration 0005_public_role makes room for public access:
a custom role you named public is renamed public-legacy (its users and API tokens keep
it). Public access itself is off until you grant something to the new public role.
0.5.0¶
Breaking changes
- Self-registration is off by default.
POST /auth/registerreturns403unlessauth.registrationisopen, and a registered account is never made admin, even on an empty database. Existing accounts are unchanged. If your front-end lets visitors sign up, setGOHEAD_AUTH_REGISTRATION=open. - The first admin comes from the configuration or the CLI: set
GOHEAD_ADMIN_USERNAME,GOHEAD_ADMIN_EMAILandGOHEAD_ADMIN_PASSWORD(12+ characters) before the first start, or rungohead admin create. Only matters for new installs. -
PostgreSQL: name columns get a length.
collections.name,components.name,singletons.name,agents.nameandusers.slugbecomevarchar(191),api_tokens.hashvarchar(64)andmedia.keyvarchar(255)(they weretext). The migration fails if an existing value is longer; check first:SELECT 'collections', max(length(name)) FROM collections UNION ALL SELECT 'components', max(length(name)) FROM components UNION ALL SELECT 'singletons', max(length(name)) FROM singletons UNION ALL SELECT 'agents', max(length(name)) FROM agents UNION ALL SELECT 'users.slug', max(length(slug)) FROM users; -
MySQL users of earlier versions: GoHead did not work on MySQL before 0.5 (JSONB columns). Start from a new database.
Before upgrading
- Content language: existing content is labelled with the default locale,
enunlessGOHEAD_I18N_DEFAULT_LOCALEsays otherwise. If your content is in another language, set it before the first start of 0.5 (localization). - MySQL: use
loc=UTCin MySQL URLs.
The first start applies three migrations:
0001_baseline: the schema as earlier versions created it.0002_revisions: content history. Existing entries get their first revision on their next change.0003_i18n: localization.
Also new, with no action needed:
- custom roles. Built-in roles keep their rights.
Publishing now needs the
publishpermission, whicheditorandadminhave. - agent run history and limits, and scoped agent functions;
- API tokens and outbound webhooks;
- the OpenAPI document;
- the complete admin UI.
0.4.0¶
Breaking changes
- GraphQL:
mediaattributes areMediaobjects instead of strings: querycover { url }instead ofcover. REST is unchanged.
0.3.0¶
Breaking changes
- Every item response is a flat object (
{"id": 1, "title": …}). Single items, create/update responses and singletons used{id, attributes}: clients that readdata.attributes.xmust readdata.x. - Attribute names
id,createdAt,updatedAtandpublishedAtare reserved.