migration

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context) error

func Init

func Init(db *gorm.DB)

func Register

func Register(scripts []Script, comment string)

Types

type MigrationHistory

type MigrationHistory struct {
	CreatedAt     time.Time
	ScriptVersion uint64 `gorm:"primarykey"`
	ScriptName    string `gorm:"primarykey;type:varchar(255)"`
	Comment       string
}

func (MigrationHistory) TableName

func (MigrationHistory) TableName() string

type Script

type Script interface {
	Up(ctx context.Context, db *gorm.DB) error
	Version() uint64
	Name() string
}

Jump to

Keyboard shortcuts

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