migration

package
v0.0.0-...-06bfaea Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package migrations provides a set of functions to perform db migrations and track their runs against the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppliedMigrations

func AppliedMigrations(ctx context.Context, dbx *sqlx.DB) ([]string, error)

AppliedMigrations returns the migrations currently in the log.

func Migrate

func Migrate(ctx context.Context, db *sqlx.DB, migrationDir fs.FS) ([]string, error)

Migrate applies the mgirations in the given directory using the connection.

It ensures that a `migration_log` table is created to keep track of and checkpoint the state of the database in case of a bad/failing migration.

Returns the name of the migrations that were applied.

Types

This section is empty.

Jump to

Keyboard shortcuts

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