migrator

package
v0.0.0-...-4be01c1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMigration

func AddMigration(databaseName string, filename string, up func(*sql.Tx) error, down func(*sql.Tx) error)

AddMigration : Add a migration.

func CollectMigrations

func CollectMigrations(current, target int64, databaseName string) (goose.Migrations, error)

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

func DownTo

func DownTo(db *sql.DB, version int64, databaseName string) error

DownTo rolls back migrations to a specific version.

func Run

func Run(database *sql.DB, databaseName string) error

func RunDownTo

func RunDownTo(database *sql.DB, databaseName string, version int64) error

func Status

func Status(db *sql.DB, databaseName string) error

Status prints the status of all migrations.

func Up

func Up(db *sql.DB, databaseName string) error

Up 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