repository

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func CreateMigrationsTable

func CreateMigrationsTable(db *gorm.DB) error

func CreateVersionTable

func CreateVersionTable(db *gorm.DB) error

func GetMigrationsSorted

func GetMigrationsSorted(db *gorm.DB, order Order) ([]models.MigrationModel, error)

func GetVersion

func GetVersion(db *gorm.DB) (string, error)

func HasMigrationsTable

func HasMigrationsTable(db *gorm.DB) bool

func HasVersionTable

func HasVersionTable(db *gorm.DB) bool

func SaveMigration

func SaveMigration(db *gorm.DB, request SaveMigrationRequest) (models.MigrationModel, error)

func SaveVersion

func SaveVersion(db *gorm.DB, version string) error

func UpdateMigrationState

func UpdateMigrationState(db *gorm.DB, model *models.MigrationModel, state models.MigrationState) error

func UpdateMigrationStateExecuted

func UpdateMigrationStateExecuted(db *gorm.DB, model *models.MigrationModel, state models.MigrationState, checksum string) error

Types

type Order

type Order string
const (
	OrderASC  Order = "ASC"
	OrderDESC Order = "DESC"
)

type SaveMigrationRequest

type SaveMigrationRequest struct {
	Rank        int
	Type        string
	Version     string
	Description string
	State       models.MigrationState
}

Jump to

Keyboard shortcuts

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