Help us shape the future of Go! Take the 2026 Go Developer Survey

migrate

package
v0.0.0-...-e3c07e6 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: 10 Imported by: 0

Documentation

Overview

Package migrate applies the embedded schema migrations to a Postgres database using github.com/pressly/goose/v3 as the runner.

Each migration is a numbered .sql file under internal/migrate/sql/ prefixed with `-- +goose Up`. Forward-only by design — we don't write down migrations. New migrations: `internal/migrate/sql/NNN_subject.sql` where NNN is the next zero-padded sequence.

Run is idempotent. An already-migrated database is detected and its goose ledger is seeded so nothing re-runs (which matters because migrations 019/022 DROP and recreate the messaging tables). Go's own legacy `_fc_migrations` tracker, the previous platform's `_schema_migrations` tracker (never trusted by number), and a populated-but-untracked schema are all recognised. See bootstrap for the precedence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, pool *pgxpool.Pool) error

Run applies every pending migration to pool's database.

Types

This section is empty.

Jump to

Keyboard shortcuts

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