Documentation
¶
Overview ¶
Package migration provides tools for performing data migrations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Driver string `json:"driver"` DSN string `json:"dsn"` DropSchema bool `json:"drop_schema"` }
Config concludes important configuration values which will be consumed by the migration manager.
type Manger ¶
type Manger struct {
// contains filtered or unexported fields
}
Manager represents a migration manager. Using a provided database connection it will migrate (i. e. create the database table schema) for all entities.
func NewManager ¶
NewManager creates a new manager instance and returns a reference to it. config has to be ready to use for the manager, populated with useful values.
func (*Manger) RunPreparation ¶
func (m *Manger) RunPreparation()
RunPreparation `prepares` the database, meaning that it will create one or more table for each entity, depending on their Create method. Dropping each table requires an explicit opt-in flag.