aboutsummaryrefslogtreecommitdiffstats
path: root/internal/services/migration.go
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2024-03-02 08:50:27 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2024-03-02 08:50:27 -0500
commit4daf960b457fe1ab27e405c1c1d56e9cfc7c904e (patch)
treeccdb3dfc260ce03339814d6b183e5599c78a87fa /internal/services/migration.go
parentIgnore cover.out file (diff)
downloadcli-4daf960b457fe1ab27e405c1c1d56e9cfc7c904e.zip
Add proper tests to revert service methods
Diffstat (limited to 'internal/services/migration.go')
-rw-r--r--internal/services/migration.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/services/migration.go b/internal/services/migration.go
index bc4b9d1..446f267 100644
--- a/internal/services/migration.go
+++ b/internal/services/migration.go
@@ -189,6 +189,8 @@ func (ms MigrationService) RevertDownToVersion(version string) error {
return fmt.Errorf("migration with version %s does not exist", version)
}
if !targetMigration.Applied {
+ // Assumption: Every migration from the latest down to the target
+ // migration hasn't been applied.
return fmt.Errorf(
"migration with version %s isn't applied, nothing to revert",
version,