Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration struct {
Version int64
Name string
Dir string // "up" or "down"
File string
SQL string
Checksum string
}
Migration is a versioned SQL change.
type Options ¶
type Options struct {
// MigrationsDir is kept for backward compatibility. If non-empty,
// it will be appended to MigrationsDirs.
MigrationsDir string
// MigrationsDirs allows loading migrations from multiple directories.
// Directories are processed in order; later files with the same name
// override earlier ones before parsing.
MigrationsDirs []string
// EmbeddedFSs allows loading migrations from multiple embedded
// filesystems. Each is expected to contain a "migrations" directory.
// Embedded filesystems are appended after explicit directories.
EmbeddedFSs []fs.FS
TableName string
LockKey int64
// AllowDangerousDown enables Down(); keep disabled in API binaries.
AllowDangerousDown bool
// Logger outputs formatted status messages.
Logger func(format string, args ...any)
}
Options configures the runner.
Click to show internal directories.
Click to hide internal directories.