Documentation
¶
Index ¶
- func CheckLatestVersion(sourceDriver source.Driver, currentVersion uint) error
- func Down(db *sql.DB) error
- func EnsureClean(db *sql.DB) error
- func GetMigrationsHash() string
- func Stepper(db *sql.DB) (next func() (version uint, more bool, err error), err error)
- func Up(db *sql.DB) error
- func UpWithFS(db *sql.DB, migs fs.FS) (retErr error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckLatestVersion ¶
Returns nil if currentVersion corresponds to the latest available migration, otherwise an error explaining why not.
func EnsureClean ¶
EnsureClean checks whether all migrations for the current version have been applied, without making any changes to the database. If not, returns a non-nil error.
func GetMigrationsHash ¶ added in v2.18.0
func GetMigrationsHash() string
func Stepper ¶
Stepper returns a function that runs SQL migrations one step at a time.
Stepper cannot be closed pre-emptively, it must be run to completion (or until an error is encountered).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.