Documentation ¶
Index ¶
- type Loader
- type Meta
- type MigrateCommand
- type Migration
- type MigrationError
- type Migrator
- type Step
- type StepConfig
- type VersionTableManager
- func (m *VersionTableManager) CheckExists(ctx context.Context, conn *pgx.Conn) (ok bool, err error)
- func (m *VersionTableManager) FinishVersionDown(ctx context.Context, conn *pgx.Conn, version int) error
- func (m *VersionTableManager) FinishVersionUp(ctx context.Context, conn *pgx.Conn, version int) error
- func (m *VersionTableManager) GetCurrentVersion(ctx context.Context, conn *pgx.Conn) (int, error)
- func (m *VersionTableManager) InsertVersionUp(ctx context.Context, conn *pgx.Conn, version int) error
- func (m *VersionTableManager) Migration() Migration
- func (m *VersionTableManager) StartVersionDown(ctx context.Context, conn *pgx.Conn, version int) error
- func (m *VersionTableManager) StartVersionUp(ctx context.Context, conn *pgx.Conn, version int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MigrateCommand ¶
type MigrateCommand struct { Database string `cli:"required,short=d,env=PGT_DATABASE,help=database connection string"` Source string `cli:"required,short=s,env=PGT_MIGRATION_SOURCE,help=path to migrations directory"` Target *int `cli:"short=t,env=PGT_MIGRATION_TARGET,help=version to target,default=latest"` VersionTable string `cli:"env=PGT_VERSION_TABLE"` Yes bool `cli:"short=y,help=bypass all confirmation prompts"` Test bool `cli:"env=PGT_TEST,help=enable test mode"` TestDatabaseName string RetainTestDatabase bool Dump string `cli:"env=PGT_DUMP,help=file path to dump schema to"` DumpCommand string `cli:"env=PGT_DUMP_COMMAND,help=command used to dump schema"` MaxBlockDuration time.Duration `cli:"env=PGT_MAX_BLOCK_DURATION"` MaxBlockProcesses int `cli:"env=PGT_MAX_BLOCK_PROCESSES"` // contains filtered or unexported fields }
func NewMigrateCommand ¶
func NewMigrateCommand(interactive bool) *MigrateCommand
func (*MigrateCommand) SetupCommand ¶
func (*MigrateCommand) SetupCommand(cmd *cli.Command)
type MigrationError ¶
func (MigrationError) Error ¶
func (e MigrationError) Error() string
type Migrator ¶
type Migrator struct { BeforeExec func(meta Meta, step Step) error // contains filtered or unexported fields }
func NewMigrator ¶
func (*Migrator) MaxVersion ¶
type StepConfig ¶
type StepConfig struct {
DisableTransaction bool
}
type VersionTableManager ¶
type VersionTableManager struct {
TableName string
}
func (*VersionTableManager) CheckExists ¶
func (m *VersionTableManager) CheckExists(ctx context.Context, conn *pgx.Conn) (ok bool, err error)
func (*VersionTableManager) FinishVersionDown ¶
func (m *VersionTableManager) FinishVersionDown(ctx context.Context, conn *pgx.Conn, version int) error
func (*VersionTableManager) FinishVersionUp ¶
func (m *VersionTableManager) FinishVersionUp(ctx context.Context, conn *pgx.Conn, version int) error
func (*VersionTableManager) GetCurrentVersion ¶
func (m *VersionTableManager) GetCurrentVersion(ctx context.Context, conn *pgx.Conn) (int, error)
func (*VersionTableManager) InsertVersionUp ¶
func (m *VersionTableManager) InsertVersionUp(ctx context.Context, conn *pgx.Conn, version int) error
func (*VersionTableManager) Migration ¶
func (m *VersionTableManager) Migration() Migration
func (*VersionTableManager) StartVersionDown ¶
func (m *VersionTableManager) StartVersionDown(ctx context.Context, conn *pgx.Conn, version int) error
func (*VersionTableManager) StartVersionUp ¶
func (m *VersionTableManager) StartVersionUp(ctx context.Context, conn *pgx.Conn, version int) error
Click to show internal directories.
Click to hide internal directories.