migrations

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 10 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
	SQL     string
}

func Embedded

func Embedded() ([]Migration, error)

Embedded возвращает список SQL-миграций, отсортированных по версии.

type Runner

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

func NewEmbeddedRunner

func NewEmbeddedRunner(db *sql.DB) (*Runner, error)

func NewRunner

func NewRunner(db *sql.DB, migrations []Migration) (*Runner, error)

func (*Runner) Up

func (r *Runner) Up(ctx context.Context) error

Up применяет миграции в порядке возрастания версий.

Jump to

Keyboard shortcuts

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