migration

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package migration provides SQL migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migration

type Migration struct {
	Name      string
	UpQuery   string
	DownQuery string
}

Migration is one schema change.

type MigrationSet

type MigrationSet []Migration

MigrationSet is an ordered migration list.

func (MigrationSet) Join

func (set MigrationSet) Join(arg MigrationSet) MigrationSet

Join appends migrations.

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

Migrator applies migrations.

func NewMigrator

func NewMigrator(ctx context.Context, ds *pgxext.DataSource) *Migrator

NewMigrator creates a Migrator.

func (*Migrator) Down

func (migrator *Migrator) Down(migrations MigrationSet) error

Down reverts applied migrations.

func (*Migrator) Up

func (migrator *Migrator) Up(migrations MigrationSet) error

Up applies pending migrations.

Jump to

Keyboard shortcuts

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