migrate

command
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Command migrate applies the database migrations.

It is a program of its own rather than a step in the server's startup, and that is the whole point of it: with several replicas, a migration at startup means one migrator per pod and no order between them. Here it runs once - as a Compose service the application waits for, and as a Helm pre-upgrade hook (deployment.md §2).

Two properties matter more than anything else it does:

  • Only one migrator at a time. A PostgreSQL advisory lock held for the length of the run, so a second one waits rather than interleaves. A retried hook, a rollout started twice, an operator running it by hand during a deploy - all of them wait.
  • Forward only. goose applies what has not been applied; there is no down. Recovery from a bad deploy is a restore, not a reversal (rule 12, ADR-0003).

The migrations travel inside the binary, so the schema a version brings and the code that reads it cannot come apart.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL