migrations

package
v0.0.0-...-60b8695 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Apply

func Apply(ctx context.Context, db *gorm.DB, migrations ...Migration) error

Types

type Migration

type Migration interface {
	// Name returns the name of the migration.
	Name() string
	// Apply applies the changes imposed by the migration to the given database (or transaction).
	Apply(context.Context, *gorm.DB) error
	// Rollback rolls back the changes imposed by the migration to the given database (or transaction).
	Rollback(context.Context, *gorm.DB) error
}

Migration abstracts away the logic of a migration.

Jump to

Keyboard shortcuts

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