Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ContainerID defines the id to be used as the container registration id // of a migrator instance, and as a base id of all other migration // package instances registered in the application container. ContainerID = rest.ContainerID + ".migration" // ContainerMigrationTag defines the default tag to be used to identify // a migration entry in the container. ContainerMigrationTag = ContainerID + ".migration" )
View Source
const ( // Env defines the gapp-rest/migration package environment entry id // base string. Env = rest.Env + "_MIGRATION" // EnvContainerDatabaseID defines the name of the environment variable // to be checked for an overriding value for the migration dao assigned // db interface instance. EnvContainerDatabaseID = Env + "_CONTAINER_DATABASE_ID" // EnvAutoMigrate defines the name of the environment variable // to be checked if an automatic migration should be executed at boot. EnvAutoMigrate = Env + "_AUTO_MIGRATE" )
Variables ¶
View Source
var ( // ContainerDatabaseID defines the default container id to be used when // retrieving the migration db connection. ContainerDatabaseID = db.ContainerPrimaryID // AutoMigrate defines the flag that will be used to enable the auto // migration on application boot. AutoMigrate = true )
Functions ¶
func NewProvider ¶
NewProvider will create a new migration provider instance
Types ¶
type Dao ¶ added in v1.5.0
type Dao interface { Last() model Up(rec model) model }
Dao defines an interface to the migration DAO instance responsible to manager the installed migrations.
type Migrator ¶
Migrator defines the interface of an application persistence layer migration manager.
func NewMigrator ¶ added in v1.5.0
NewMigrator instantiates a new migration manager instance.
Click to show internal directories.
Click to hide internal directories.