Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrHashMismatch is returned when a changeset was already applied, but the queries changed. ErrHashMismatch = errors.New("migration: hash does not match already applied version") // ErrNameTooLong is returned when a changeset name exceeds the limit. ErrNameTooLong = errors.New("migration: changeset name too long (max. 256)") )
Functions ¶
This section is empty.
Types ¶
type Changeset ¶
type Changeset interface { // Name returns the name of the changeset. // It is used to keep track of already applied changesets. Name() string // Queries returns the content of this changeset as raw sql. Queries() (string, error) }
Changeset represents a series of related queries to advance the database schema.
func LiteralChangeset ¶
func Up ¶
Up applies all changesets in order, if they have not already been applied. All changesets are applied within a transaction. When an error occurs, the process will stop, but previously applied changesets won't be rolled back. When a changeset was already applied, but does not match in content, an errors is returned. Up expects a groundwork/noorm.Querier to be present in the context (see WithDatabase).
Click to show internal directories.
Click to hide internal directories.