gormigrate

package module
v0.0.0-...-7b7b2fe Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB, userMigrations []Migrator) (bool, error)

Types

type MigrateFunc

type MigrateFunc func(*gorm.DB) error

type Migration

type Migration struct {
	gorm.Model
	Version   int `gorm:"uniqueIndex"`
	Name      string
	IsApplied bool
}

func (Migration) TableName

func (Migration) TableName() string

type Migrator

type Migrator struct {
	Version int
	Name    string
	Up      MigrateFunc
	Down    MigrateFunc
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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