Documentation
¶
Overview ¶
Package migrate installs and removes the Foreman schema with embedded SQL migrations.
Index ¶
- Variables
- func Down(ctx context.Context, db DB, opts ...Option) error
- func Latest() int
- func SQL(up bool, opts ...Option) (string, error)
- func Up(ctx context.Context, db DB, opts ...Option) error
- func Version(ctx context.Context, db DB, opts ...Option) (int, error)
- type DB
- type Migration
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownVersion = errors.New("migrate: database has a version this binary does not know")
ErrUnknownVersion reports a database migrated by a newer Foreman.
Functions ¶
Types ¶
type Migration ¶
Migration is one embedded schema version.
func Migrations ¶
Migrations returns the embedded migrations in version order.
type Option ¶
type Option func(*options)
Option configures a migration run.
func WithSchema ¶
WithSchema installs Foreman into schema instead of public.
func WithTargetVersion ¶
WithTargetVersion stops Down at version v instead of removing everything.
Click to show internal directories.
Click to hide internal directories.