Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶ added in v0.5.0
func New(source *Source, updateVersion UpdateVersion, applied AppliedVersions, config *Config) (m.Driver, error)
NewGolang creates a new Go migration driver. It requires a source a function for saving the executed migration version, a function for deleting a version that was migrated downwards, a function for listing all applied migrations and optionally a configuration.
Types ¶
type AppliedVersions ¶ added in v0.5.0
type Config ¶ added in v0.5.0
func NewConfig ¶ added in v0.5.0
func NewConfig() *Config
NewGolangConfig creates a concurrency-safe configuration map for passing configuration data and things like database handlers to your migrations.
type Driver ¶ added in v0.5.0
type Driver struct {
// contains filtered or unexported fields
}
type Source ¶ added in v0.5.0
func NewSource ¶ added in v0.5.0
func NewSource() *Source
NewGolangSource creates a source for storing Go functions as migrations.
func (*Source) AddMigration ¶ added in v0.5.0
AddMigration adds a new migration to the source. The file parameter follows the same conventions as you would use for a physical file for other types of migrations, however you should omit the file extension. Example: 1_init.up and 1_init.down
func (*Source) GetMigrationFile ¶ added in v0.5.0
GetMigrationFile retrieves a migration given the filename.
func (*Source) ListMigrationFiles ¶ added in v0.5.0
ListMigrationFiles lists the available migrations in the source