iofs

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package iofs contains functions that allows to work with migration using io/fs package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectMigrations

func CollectMigrations(fsys fs.FS, dirpath string, current, target int64) (goose.Migrations, error)

CollectMigrations returns all the valid looking migration scripts in the migrations folder and key them by version.

func Down

func Down(db *sql.DB, fsys fs.FS, dir string) error

Down rolls back a single migration from the current version.

func DownTo

func DownTo(db *sql.DB, fsys fs.FS, dir string, version int64) error

DownTo rolls back migrations to a specific version.

func Redo

func Redo(db *sql.DB, fsys fs.FS, dir string) error

Redo rolls back the most recently applied migration, then runs it again.

func Reset

func Reset(db *sql.DB, fsys fs.FS, dir string) error

Reset rolls back all migrations

func Status

func Status(db *sql.DB, fsys fs.FS, dir string) error

Status prints the status of all migrations.

func Up

func Up(db *sql.DB, fsys fs.FS, dir string) error

Up applies all available migrations.

func UpByOne

func UpByOne(db *sql.DB, fsys fs.FS, dir string) error

UpByOne migrates up by a single version.

func UpTo

func UpTo(db *sql.DB, fsys fs.FS, dir string, version int64) error

UpTo migrates up to a specific version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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