Versions in this module Expand all Collapse all v0 v0.0.4 Nov 11, 2023 v0.0.3 Sep 25, 2023 Changes in this version + type Loader struct + func NewLoader(fsys fs.FS) *Loader + func (l *Loader) Load() ([]Migration, error) + type Meta struct + Filename string + Name string + Version int + type MigrateCommand struct + Database string + Dump string + DumpCommand string + MaxBlockDuration time.Duration + MaxBlockProcesses int + RetainTestDatabase bool + Source string + Target *int + Test bool + TestDatabaseName string + VersionTable string + Yes bool + func NewMigrateCommand(interactive bool) *MigrateCommand + func (*MigrateCommand) SetupCommand(cmd *cli.Command) + func (cmd *MigrateCommand) Run(ctx context.Context) error + type Migration struct + Down Step + Up Step + type MigrationError struct + ColumnNum int + Err error + LineNum int + func (e MigrationError) Error() string + type Migrator struct + BeforeExec func(meta Meta, step Step) error + func NewMigrator(conn *pgx.Conn, versionTableName string, migrations []Migration) *Migrator + func (m *Migrator) MaxVersion() int + func (m *Migrator) MigrateTo(ctx context.Context, targetVersion int) (err error) + func (m *Migrator) Migration(version int) Migration + type Step struct + Config StepConfig + LineNumber int + Name string + SQL string + func (s Step) PositionToLineCol(pos int) (int, int) + type StepConfig struct + DisableTransaction bool + type VersionTableManager struct + TableName string + 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