diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2024-03-02 11:04:00 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2024-03-02 11:04:00 -0500 |
| commit | a37df93853def914dbda165cdcf09ae8e0305ec3 (patch) | |
| tree | 41fb3a459db99d1f0ec2ed2e00d4ca580a5d0c46 /internal/services/migration.go | |
| parent | improve wording (diff) | |
| download | cli-a37df93853def914dbda165cdcf09ae8e0305ec3.zip | |
Remove Latest() from migration fs repo in favor of using List on service
Diffstat (limited to 'internal/services/migration.go')
| -rw-r--r-- | internal/services/migration.go | 5 |
1 files changed, 3 insertions, 2 deletions
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 |