migrate

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(name string, up migrationFunc, down migrationFunc)

Types

type Migration

type Migration struct {
	ID        uint64 `gorm:"primaryKey;autoIncrement;"`
	Migration string `gorm:"type:varchar(255);not null;unique;"`
	Batch     int
}

type MigrationFile

type MigrationFile struct {
	Up       migrationFunc
	Down     migrationFunc
	FileName string
}

func GetMigrationFile added in v0.3.2

func GetMigrationFile(name string) MigrationFile

type Migrator

type Migrator struct {
	Folder   string
	DB       *gorm.DB
	Migrator gorm.Migrator
}

func NewMigrator

func NewMigrator(folder string) *Migrator

func (*Migrator) Fresh

func (migrator *Migrator) Fresh()

func (*Migrator) Refresh

func (migrator *Migrator) Refresh()

func (*Migrator) Reset

func (migrator *Migrator) Reset()

func (*Migrator) Rollback

func (migrator *Migrator) Rollback()

func (*Migrator) Up

func (migrator *Migrator) Up()

Jump to

Keyboard shortcuts

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