migrations

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package migrations embeds Credbound's Goose-compatible PostgreSQL migrations. Filenames are timestamps, so lexical order is application order and they interleave safely with a host's own Goose migrations. Hosts either hand PostgreSQL() to goose or call ApplyPostgreSQL for a dependency-free application path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPostgreSQL

func ApplyPostgreSQL(ctx context.Context, db *sql.DB) error

ApplyPostgreSQL applies every embedded PostgreSQL migration that has not run yet, in filename order, each inside its own transaction together with its bookkeeping row. The bookkeeping table lives on the connection's default search_path; the migrations themselves create and fill the dedicated credbound schema. It is idempotent across restarts and is the minimal alternative for hosts that do not run goose. Concurrent runs are safe: a session-level advisory lock serializes instances that start simultaneously, and each migration re-checks its bookkeeping row inside the transaction. A migration file whose content changed after it was applied fails with a checksum error instead of being silently ignored.

func PostgreSQL

func PostgreSQL() fs.FS

PostgreSQL returns the embedded PostgreSQL migrations as a Goose-compatible fs.FS. Every Credbound object they create lives in the dedicated credbound schema.

Types

This section is empty.

Jump to

Keyboard shortcuts

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