Skip to content

Commit

Permalink
Export DefaultMigratorFS
Browse files Browse the repository at this point in the history
  • Loading branch information
JosefWN committed Apr 25, 2022
1 parent 9bd8a20 commit eb2872a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion migrate/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func LoadCodePackageEx(path string, fs MigratorFS) (*CodePackage, error) {
}

func LoadCodePackage(path string) (*CodePackage, error) {
return LoadCodePackageEx(path, defaultMigratorFS{})
return LoadCodePackageEx(path, DefaultMigratorFS{})
}

func InstallCodePackage(ctx context.Context, conn *pgx.Conn, mergeData map[string]interface{}, codePackage *CodePackage) (err error) {
Expand Down
12 changes: 6 additions & 6 deletions migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type Migrator struct {

// NewMigrator initializes a new Migrator. It is highly recommended that versionTable be schema qualified.
func NewMigrator(ctx context.Context, conn *pgx.Conn, versionTable string) (m *Migrator, err error) {
return NewMigratorEx(ctx, conn, versionTable, &MigratorOptions{MigratorFS: defaultMigratorFS{}})
return NewMigratorEx(ctx, conn, versionTable, &MigratorOptions{MigratorFS: DefaultMigratorFS{}})
}

// NewMigratorEx initializes a new Migrator. It is highly recommended that versionTable be schema qualified.
Expand All @@ -104,17 +104,17 @@ type MigratorFS interface {
Glob(pattern string) (matches []string, err error)
}

type defaultMigratorFS struct{}
type DefaultMigratorFS struct{}

func (defaultMigratorFS) ReadDir(dirname string) ([]os.FileInfo, error) {
func (DefaultMigratorFS) ReadDir(dirname string) ([]os.FileInfo, error) {
return ioutil.ReadDir(dirname)
}

func (defaultMigratorFS) ReadFile(filename string) ([]byte, error) {
func (DefaultMigratorFS) ReadFile(filename string) ([]byte, error) {
return ioutil.ReadFile(filename)
}

func (defaultMigratorFS) Glob(pattern string) ([]string, error) {
func (DefaultMigratorFS) Glob(pattern string) ([]string, error) {
return filepath.Glob(pattern)
}

Expand Down Expand Up @@ -158,7 +158,7 @@ func FindMigrationsEx(path string, fs MigratorFS) ([]string, error) {
}

func FindMigrations(path string) ([]string, error) {
return FindMigrationsEx(path, defaultMigratorFS{})
return FindMigrationsEx(path, DefaultMigratorFS{})
}

func (m *Migrator) LoadMigrations(path string) error {
Expand Down

0 comments on commit eb2872a

Please sign in to comment.