migrate

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package migrate applies the module's embedded migrations. It's separate from the root package so internal packages and their tests can migrate a database without importing the root package (which would be a cycle).

Index

Constants

View Source
const Schema = "auth"

Schema is the Postgres schema that holds every table the module owns.

Variables

This section is empty.

Functions

func Run

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

Run creates the auth schema if needed and applies any pending migrations. It's idempotent and safe to call from several instances at once.

func UpTo added in v1.5.0

func UpTo(ctx context.Context, pool *pgxpool.Pool, version int64) error

UpTo is Run, but applies migrations only up to version. It's for tests that need the database as an earlier version left it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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