Skip to content

Commit 8e9fa2d

Browse files
committed
[FIX] tests
1 parent 55723ef commit 8e9fa2d

File tree

1 file changed

+11
-6
lines changed
  • internal/migration/up

1 file changed

+11
-6
lines changed

internal/migration/up/up.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,17 @@ func Run(ctx context.Context, includeAll bool, config pgconn.Config, fsys afero.
2424
return err
2525
}
2626

27-
return migration.ApplyMigrations(ctx, pending, conn, afero.NewIOFS(fsys))
27+
err = migration.ApplyMigrations(ctx, pending, conn, afero.NewIOFS(fsys))
28+
if err != nil {
29+
return err
30+
}
31+
32+
repeatableMigrations, err := migration.ListRepeatableMigrations(utils.MigrationsDir, afero.NewIOFS(fsys))
33+
if err != nil {
34+
return err
35+
}
36+
37+
return migration.ApplyMigrations(ctx, repeatableMigrations, conn, afero.NewIOFS(fsys))
2838
}
2939

3040
func GetPendingMigrations(ctx context.Context, includeAll bool, conn *pgx.Conn, fsys afero.Fs) ([]string, error) {
@@ -46,11 +56,6 @@ func GetPendingMigrations(ctx context.Context, includeAll bool, conn *pgx.Conn,
4656
}
4757
utils.CmdSuggestion = suggestIgnoreFlag(diff)
4858
}
49-
repeatableMigrations, err := migration.ListRepeatableMigrations(utils.MigrationsDir, afero.NewIOFS(fsys))
50-
if err != nil {
51-
return nil, err
52-
}
53-
diff = append(diff, repeatableMigrations...)
5459
return diff, err
5560
}
5661

0 commit comments

Comments
 (0)