migration

package module
v0.0.0-...-d706607 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 7 Imported by: 0

README

migration

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(key string, upSQLs []string, downSQLs []string) error

func AddInstance

func AddInstance(key string, instance *Instance)

AddInstance add instance

func Init

func Init(db *gorm.DB) error

Types

type Instance

type Instance struct {
	DB         *gorm.DB
	Migrations []*Migration
}

func GetInstance

func GetInstance(key string) *Instance

GetInstance get instance

func (*Instance) Add

func (receiver *Instance) Add(key string, upSQLs []string, downSQLs []string) error

Add new migration

type Migration

type Migration struct {
	Key      string
	UpSQLs   []string
	DownSQLs []string
}

Jump to

Keyboard shortcuts

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