migrations

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDownMigration

func IsDownMigration(filename string) bool

IsDownMigration reports whether down migration.

func RemoveRollbackStatements

func RemoveRollbackStatements(content string, format MigrationFormat) string

RemoveRollbackStatements performs remove rollback statements.

Types

type Migration

type Migration struct {
	FilePath   string
	Sequence   int
	Name       string
	Format     MigrationFormat
	UpSQL      string
	DownSQL    string
	Statements []string
}

Migration represents migration.

func DiscoverMigrations

func DiscoverMigrations(dirs []string) ([]Migration, error)

DiscoverMigrations performs discover migrations.

func ParseMigration

func ParseMigration(filePath string) (*Migration, error)

ParseMigration parses migration.

type MigrationFormat

type MigrationFormat int

MigrationFormat represents migration format.

const (
	// Goose is a constant value for goose.
	Goose MigrationFormat = iota
)

func (MigrationFormat) String

func (f MigrationFormat) String() string

String performs the string operation.

Jump to

Keyboard shortcuts

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