Documentation ¶
Overview ¶
Package provider provides an iterator for iterating over all of the migration statements that need to be applied. It will provide the statements in the correct order based on the Edition priority and migration version.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseState ¶
DatabaseState is a map of edition names to versions.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provides the migrations to the schema.Manager in the correct order.
func New ¶
func New(dbState DatabaseState, editions edition.Editions) *Provider
New creates a Provider. The given DatabaseState is compared against the editions to determine which migrations need to be applied and the migrations are then ordered based on the Edition priority and by the migration version.
func (*Provider) Next ¶
Next proceeds to the next migration. It returns true on success or false if there are no more migrations.
func (*Provider) PreHook ¶ added in v0.10.2
PreHook returns the hooks that should be run prior to the current migration.
func (*Provider) Statements ¶
Statements returns the sql statements name for the current migration.