Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateLatest ¶ added in v0.2.6
MigrateLatest converts the database to the latest version that we know of.
Types ¶
type Migration ¶ added in v0.2.6
type Migration struct { // StartVersion is the minimum version that is supported by the migration. StartVersion int // LatestVersion is the final version that we should expect after running migrations. LatestVersion int // Steps are the migration steps for transforming the database state across versions when run in sequence. Steps []MigrationStep // DatabaseID is an identifier for the database being migrated (e.g. opts.Dir), used for more descriptive errors. DatabaseID string }
Migration handles transforming the database state to the newest version.
type MigrationError ¶ added in v0.2.3
MigrationError is returned when the database is opened with an outdated version and migation fails.
func (MigrationError) Error ¶ added in v0.2.3
func (err MigrationError) Error() string
type MigrationStep ¶ added in v0.2.6
MigrationStep is called within an update transaction with the current version. It should update the database state to the next version. The migration step should update the database version with each step.
Click to show internal directories.
Click to hide internal directories.