migrations

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMigrationsFs embed.FS

Functions

func NewInMemoryMigratedDatabase

func NewInMemoryMigratedDatabase(t *testing.T, dbName string) (*sql.DB, error)

Types

type MigrationRunner

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

func NewMigrationRunner

func NewMigrationRunner(migrationsFsys fs.FS, migrationsPath string, appStore datastore.AppStore, logger zerolog.Logger) (*MigrationRunner, error)

func (*MigrationRunner) RunSafe

func (runner *MigrationRunner) RunSafe() error

RunSafe runs migrations if necessary: new migrations are available and the database is not dirty. It returns the current version of the database or an error. If an error occurs, the database is restored to its previous state.

Jump to

Keyboard shortcuts

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