migrations

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migration

type Migration struct {
	Version   int
	Name      string
	UpSQL     string
	DownSQL   string
	AppliedAt *time.Time
}

Migration represents a database migration

type Migrator

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

Migrator handles database migrations

func NewMigrator

func NewMigrator(db *sql.DB, driver config.DatabaseDriver) *Migrator

NewMigrator creates a new migrator

func (*Migrator) Down

func (m *Migrator) Down(ctx context.Context) error

Down rolls back the last migration

func (*Migrator) Status

func (m *Migrator) Status(ctx context.Context) error

Status shows the status of all migrations

func (*Migrator) Up

func (m *Migrator) Up(ctx context.Context) error

Up runs all pending migrations

Jump to

Keyboard shortcuts

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