types

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOnlyDirsInMigrationsFolder = errors.New("only directories are allowed in migration folder")
	ErrOnlyFilesInGroupFolder     = errors.New("only sql files are allowed in group folders")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	MigrationFolder  string
	ConnectionString string
}

type Group

type Group struct {
	GroupId int
	Name    string
	Units   []Unit
}

type GroupSummary

type GroupSummary struct {
	GroupId        int    `db:"group_id"`
	Name           string `db:"name"`
	MigrationCount int    `db:"migration_count"`
}

type Repository

type Repository interface {
	EnsureCreated() error
	SummarizeMigrations() ([]GroupSummary, error)
	GetMigrationsByGroup(groupId int) ([]string, error)
	ExecuteMigrations([]Group) error
}

type Unit

type Unit struct {
	Name       string
	FileHandle io.Reader
}

Jump to

Keyboard shortcuts

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