repositories

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMigrationVersionConflict = errors.New("migration version conflict")

Functions

This section is empty.

Types

type ErrIsNotDir added in v0.2.0

type ErrIsNotDir struct {
	// contains filtered or unexported fields
}

func (*ErrIsNotDir) Error added in v0.2.0

func (e *ErrIsNotDir) Error() string

type MigrationDBRepo added in v0.2.0

type MigrationDBRepo interface {
	List() (map[string]*models.Migration, error)
	IsApplied(version string) (bool, error)
	Apply(upgradeScript string, migration *models.Migration) error
	ApplyWithTx(upgradeScript string, migration *models.Migration) error
	Revert(downgradeScript string, migration *models.Migration) error
	RevertWithTx(downgradeScript string, migration *models.Migration) error
}

func NewMigrationDBRepo added in v0.2.0

func NewMigrationDBRepo(db storage.DB) (MigrationDBRepo, error)

NewMigrationDBRepo initializes the MigrationDBRepo with a database. Furthermore, it ensures the migration table it operates on exists. If it is unable to create or confirm the table exists, an error is returned.

type MigrationFsRepo added in v0.2.0

type MigrationFsRepo interface {
	Create(migration *models.Migration) error
	List() (map[string]*models.Migration, error)
	ReadUpgradeScript(migration *models.Migration) (sqlparse.MigrationScript, error)
	ReadDowngradeScript(migration *models.Migration) (sqlparse.MigrationScript, error)
}

func NewMigrationFsRepo added in v0.2.0

func NewMigrationFsRepo(
	migrationsConfig *configloader.MigrationsConfig,
) (MigrationFsRepo, error)

Jump to

Keyboard shortcuts

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