migration

package
v0.0.0-...-991b954 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegisteredMigrations []Migration
	MigrationsTableName  = "__migrations_meta"
)

Functions

func Register

func Register(up MigratorFunc, down MigratorFunc)

func RegisterSystemMigration

func RegisterSystemMigration(name string, up MigratorFunc, down MigratorFunc)

func RunMigrations

func RunMigrations(db *gorm.DB) error

Types

type Migration

type Migration struct {
	Name     string
	FullPath string

	NoChecksum bool

	Up   MigratorFunc
	Down MigratorFunc
}

type MigrationsMeta

type MigrationsMeta struct {
	Name     string
	Checksum string

	Timestamp time.Time
}

type MigratorFunc

type MigratorFunc func(db *gorm.DB) error

Jump to

Keyboard shortcuts

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