migrations

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package migrations owns the database schema. Migrations are versioned with goose and written as Go functions over GORM so the same code runs on Postgres (production) and sqlite (tests — keeps `go test` Docker-free).

Rules:

  • Never edit a migration that has shipped in a tagged release; add a new one. (Before v0.1.0, 00001 is still the editable baseline.)
  • Postgres-only DDL is dialect-gated inside the migration and no-ops on sqlite (see postgresSearch).
  • Up must run against a *direct* Postgres connection, not through pgbouncer in transaction-pooling mode: it holds a session-level advisory lock so concurrent instances don't race each other's DDL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Up

func Up(ctx context.Context, db *gorm.DB) error

Up applies all pending migrations. On Postgres it serializes concurrent callers with a session advisory lock (see package doc).

Types

This section is empty.

Directories

Path Synopsis
Package baseline is a frozen snapshot of the schema that migration 00001 creates.
Package baseline is a frozen snapshot of the schema that migration 00001 creates.

Jump to

Keyboard shortcuts

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