migrate

package
v0.0.0-...-aac4589 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Migrations []Migration

Migrations represents a sets of migrations

Functions

func Register

func Register(Factory Factory)

Register registers a new factory for a migration

Types

type Factory

type Factory func(ctx xcontext.Context) Migrate

Factory defines a factory type of an object implementing Migration interface

type Migrate

type Migrate interface {
	Up(tx *sql.Tx) error
	Down(tx *sql.Tx) error
	UpNoTx(db *sql.DB) error
	DownNoTx(db *sql.DB) error
}

Migrate is the interface that every migration task must implement to support

type Migration

type Migration struct {
	Factory Factory
	Name    string
}

Migration represents a migration task registered in the migration tool

Jump to

Keyboard shortcuts

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