migration

package
v0.0.0-...-433870c Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

type Migrator interface {
	Migrate() error
}

func New

func New(db *sql.DB, version VersionRepository, migrationFileDirectory string, log *logrus.Logger) Migrator

type VersionRepository

type VersionRepository interface {

	// Gets the current version of the database
	// If this is the first setup of the database, this call could fail because of missing structures in the database
	// In this case the version should be -1 and no error should be returned
	// Be careful not to hide implementation mistakes that way
	GetDatabaseVersion() (int, error)
	BumpVersion(newVersion int) error
}

VersionRepository defines a method to check the version of the database

Jump to

Keyboard shortcuts

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