Upgrading to 0.2.0
At a glance
| Database migrations | Two, additive: 20261121000029_pat_propose_scope (allows the propose token scope) and 20261122000030_change_request_create (adds change_requests.action, default update, and a unique index: one pending flag creation per key) |
| Required configuration changes | None |
| SDK compatibility | The SDK protocol is unchanged: the /flags/snapshot body was byte-identical before and after the upgrade on the same data. SDKs of 0.1.31 and 0.2.0 work with either server |
| Behaviour change | In an environment that requires approval, creating a flag that is not inert (enabled, or with its own disabled_value) answers 202 Accepted with a pending change request instead of 200 — see Governance |
| Mixed versions (rolling upgrade) | Not supported. Once a 0.2.0 instance has applied the migrations, a 0.1.31 instance refuses to start (migration 20261121000029 was previously applied but is missing). Instances already running keep running — see the token rule below |
| Rollback to 0.1.31 | Needs one database step (below) |
All of this was tested with release builds of 0.1.31 and a 0.2.0 candidate on real databases (bench/ab/upgrade_rollback_020.py: upgrade, mixed versions, the rollback below, re-upgrade, restore from a backup, and an upgrade killed half-way).
Upgrade
- Back up the database (for example
pg_dump --format=custom --file=checkgate-0.1.31.dump "$DATABASE_URL"). It is the only way back that also undoes data written by 0.2.0. - Replace every instance with 0.2.0. Plan for all 0.1.31 instances to be stopped before any of them restarts: after the first 0.2.0 instance starts, a restarted 0.1.31 instance exits at boot.
- Create no
proposetokens until no 0.1.31 instance is serving. A 0.1.31 server does not know the scope: it refuses aproposetoken's flag writes (anything that is notread_writeis read-only there) but lets it create aread_writetoken, because 0.1.31 only caps tokens created byread_onlytokens. A request routed to an old instance during the upgrade could therefore turn an agent's token into a full one.
Rolling back
To run 0.1.31 again on the same database:
Stop every 0.2.0 instance.
Revoke all
proposetokens — 0.1.31 would let them mintread_writetokens:sqlDELETE FROM personal_access_tokens WHERE scope = 'propose';Cancel pending flag creations. 0.1.31 does not know the
createaction: approving one there answers404while the key does not exist, but would apply it as a patch once someone has created that key:sqlUPDATE change_requests SET status = 'cancelled' WHERE action = 'create' AND status = 'pending';Remove the migrations' records, so the 0.1.31 migrator accepts the database:
sqlDELETE FROM _sqlx_migrations WHERE version IN (20261121000029, 20261122000030);The widened scope check, the
actioncolumn and its index stay in place; 0.1.31 never writesproposeand its inserts getaction = 'update', so they are harmless. Upgrading again re-applies both migrations (they are idempotent).Start 0.1.31.
Rolling back by restoring the backup
The SQL steps above keep everything 0.2.0 wrote (flags, approvals, audit entries). To return to exactly the pre-upgrade state instead — losing every change made since — stop all instances and restore the backup from upgrade step 1 into an empty database:
pg_restore --no-owner --dbname "$EMPTY_DATABASE_URL" checkgate-0.1.31.dumpPoint 0.1.31 at that database. SDKs reconnect and receive the restored flags. Changes made under 0.2.0 are gone; there is no merge.
If the upgrade is interrupted
Each migration runs in its own transaction, so a 0.2.0 process killed during the upgrade leaves every migration either fully applied or not at all — never a half-applied one (tested by killing 0.2.0 while migration 30 waited on a lock: 29 was applied, 30 was not, and the schema had no partial change). Starting 0.2.0 again applies whatever is missing and serves the same data. A 0.1.31 instance refuses such a database as soon as one 0.2.0 migration is recorded; either finish the upgrade by starting 0.2.0, or roll back with the steps above (only the recorded rows need deleting).
What else changes
See the changelog for the full list: new SDK surfaces (OpenFeature provider, Python SDK, framework integrations), the evaluation playground endpoint, SDK diagnostics endpoints and metrics, propose tokens and the MCP server. None of them changes existing endpoints, configuration or SDK behaviour, except that a Node.js client now marks itself ready before announcing streaming to status listeners.