Documentation ¶
Overview ¶
Package migrate manage DB migrations.
Index ¶
- Variables
- func MySQLUpDownTest(t *check.C, ctx Ctx, goose *goosepkg.Instance, dir string, cfg *mysql.Config)
- func PostgresUpDownTest(t *check.C, ctx Ctx, goose *goosepkg.Instance, dir string, ...)
- func Run(ctx Ctx, goose *goosepkg.Instance, dir string, command string, c Connector) error
- func UpTo(ctx Ctx, goose *goosepkg.Instance, dir string, version int64, c Connector) (*schemaver.SchemaVer, error)
- type Connector
- type Ctx
- type MySQL
- type Postgres
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDownNotSupported = errors.New("downgrade is not supported, restore from backup instead")
ErrDownNotSupported must be returned from goose Down function in case this migration does not support downgrade.
Functions ¶
func MySQLUpDownTest ¶ added in v0.4.0
MySQLUpDownTest creates temporary database, test given migrations, and removes temporary database.
func PostgresUpDownTest ¶ added in v0.4.0
func PostgresUpDownTest(t *check.C, ctx Ctx, goose *goosepkg.Instance, dir string, cfg *def.PostgresConfig)
PostgresUpDownTest creates temporary database, test given migrations, and removes temporary database.
Types ¶
type Connector ¶ added in v0.4.0
type Connector interface {
Connect(Ctx, *goosepkg.Instance) (*sql.DB, *schemaver.SchemaVer, error)
}
Connector provides a way to connect to any database with schemaver.
type Postgres ¶ added in v0.4.0
type Postgres struct {
*def.PostgresConfig
}
Postgres implements Connector interface.
Click to show internal directories.
Click to hide internal directories.