fix: migrator base path

This commit is contained in:
Steven 2024-08-29 20:31:37 +08:00
parent baa3378ff7
commit 220cabfb5b

View File

@ -61,7 +61,7 @@ func (s *Store) Migrate(ctx context.Context) error {
} }
if common.IsVersionGreaterThan(schemaVersion, latestMigrationHistoryVersion) { if common.IsVersionGreaterThan(schemaVersion, latestMigrationHistoryVersion) {
filePaths, err := fs.Glob(migrationFS, fmt.Sprintf("%s/*/*.sql", s.getMigrationBasePath())) filePaths, err := fs.Glob(migrationFS, fmt.Sprintf("%s*/*.sql", s.getMigrationBasePath()))
if err != nil { if err != nil {
return errors.Wrap(err, "failed to read migration files") return errors.Wrap(err, "failed to read migration files")
} }
@ -265,7 +265,7 @@ func (s *Store) normalizedMigrationHistoryList(ctx context.Context) error {
latestMinorVersion := common.GetMinorVersion(latestVersion) latestMinorVersion := common.GetMinorVersion(latestVersion)
schemaVersionMap := map[string]string{} schemaVersionMap := map[string]string{}
filePaths, err := fs.Glob(migrationFS, fmt.Sprintf("%s/*/*.sql", s.getMigrationBasePath())) filePaths, err := fs.Glob(migrationFS, fmt.Sprintf("%s*/*.sql", s.getMigrationBasePath()))
if err != nil { if err != nil {
return errors.Wrap(err, "failed to read migration files") return errors.Wrap(err, "failed to read migration files")
} }