migration

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Migrate = &Migration{
	version: make(map[int]func(db *gorm.DB, version string) error),
}

Functions

func GenFile

func GenFile(system bool, path string) error

func GetFilename

func GetFilename(s string) int

Types

type Migration

type Migration struct {
	Model Version
	// contains filtered or unexported fields
}

func (*Migration) CreateVersion added in v0.1.3

func (e *Migration) CreateVersion(tx *gorm.DB, v string) error

func (*Migration) GetDb

func (e *Migration) GetDb() *gorm.DB

func (*Migration) Migrate

func (e *Migration) Migrate()

func (*Migration) SetDb

func (e *Migration) SetDb(db *gorm.DB)

func (*Migration) SetModel added in v0.1.3

func (e *Migration) SetModel(v Version)

func (*Migration) SetVersion

func (e *Migration) SetVersion(k int, f func(db *gorm.DB, version string) error)

type Version added in v0.1.3

type Version interface {
	schema.Tabler
	SetVersion(string)
	Done(*gorm.DB) (bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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