Add vendor directory and update vendorHash to null

This commit is contained in:
soup 2026-01-17 22:29:54 -05:00
parent 523831cb8d
commit 1e5424c844
Signed by: soup
SSH key fingerprint: SHA256:GYxje8eQkJ6HZKzVWDdyOUF1TyDiprruGhE0Ym8qYDY
778 changed files with 407919 additions and 1 deletions

51
vendor/github.com/pressly/goose/v3/redo.go generated vendored Normal file
View file

@ -0,0 +1,51 @@
package goose
import (
"context"
"database/sql"
)
// Redo rolls back the most recently applied migration, then runs it again.
func Redo(db *sql.DB, dir string, opts ...OptionsFunc) error {
ctx := context.Background()
return RedoContext(ctx, db, dir, opts...)
}
// RedoContext rolls back the most recently applied migration, then runs it again.
func RedoContext(ctx context.Context, db *sql.DB, dir string, opts ...OptionsFunc) error {
option := &options{}
for _, f := range opts {
f(option)
}
migrations, err := CollectMigrations(dir, minVersion, maxVersion)
if err != nil {
return err
}
var (
currentVersion int64
)
if option.noVersioning {
if len(migrations) == 0 {
return nil
}
currentVersion = migrations[len(migrations)-1].Version
} else {
if currentVersion, err = GetDBVersionContext(ctx, db); err != nil {
return err
}
}
current, err := migrations.Current(currentVersion)
if err != nil {
return err
}
current.noVersioning = option.noVersioning
if err := current.DownContext(ctx, db); err != nil {
return err
}
if err := current.UpContext(ctx, db); err != nil {
return err
}
return nil
}