Documentation
¶
Index ¶
Constants ¶
View Source
const ( // NilVersion is a Claytons version // "the version you are at when you are not at a version" NilVersion = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration interface {
// The version of this migration
Version() int64
// Run the migration
Run(*sql.Tx) error
}
Migration interface
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
A Migrator collates and runs migrations
func NewFileMigrator ¶
NewFileMigrator creates a new set of migrations from a path Each one is run in a transaction.
func NewStringMigrator ¶
NewStringMigrator creates a new set of migrations from a slice of strings Each one is run in a transaction.
func (*Migrator) Migrate ¶
Migrate migrates the database to the highest possible version
func (*Migrator) MigrateTo ¶
MigrateTo migrates the database to the specified version
type Option ¶
An Option configures a migrator
func SetCallback ¶
func SetCallback(cb ResultFunc) Option
SetCallback configures the table used for recording the schema version
Source Files
¶
- file.go
- migrate.go
- options.go
- string.go
Click to show internal directories.
Click to hide internal directories.