From a37df93853def914dbda165cdcf09ae8e0305ec3 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 2 Mar 2024 11:04:00 -0500 Subject: Remove Latest() from migration fs repo in favor of using List on service --- internal/services/migration.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/services/migration.go') diff --git a/internal/services/migration.go b/internal/services/migration.go index a91ae2a..4be10cc 100644 --- a/internal/services/migration.go +++ b/internal/services/migration.go @@ -283,12 +283,13 @@ func (ms MigrationService) CreateMigration(message string) (*models.Migration, e func (ms MigrationService) getCurrentSequentialMigrationVersion() (uint64, error) { var currentVersion uint64 = 0 - latestMigration, err := ms.fsRepo.Latest() + migrations, err := ms.ListMigrations(SortOrderDesc) if err != nil { return 0, err } - if latestMigration != nil { + if len(migrations) > 0 { + latestMigration := migrations[0] currentVersion, err = strconv.ParseUint(latestMigration.Version, 10, 64) if err != nil { return 0, err -- cgit v1.2.3