migrate

package
v0.328.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package migrate supports a dbmate-compatible superset of migration files.

The superset is that in addition to a migration being a .sql file, it can also be a Go function which is called to execute the migration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(ctx context.Context, db *sql.DB, migrationFiles fs.FS, migrationFuncs ...Migration) error

Migrate applies all migrations in the provided fs.FS and migrationFuncs to the provided database.

Migration functions must be named in the form "MigrationYYYYMMDDHHMMSS<detail>".

Types

type Migration

type Migration func(ctx context.Context, db *sql.Tx) error

Jump to

Keyboard shortcuts

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