Skip to content

Commit a2a1c24

Browse files
committed
fixes hash migration v4 not updating config
1 parent 6bbc176 commit a2a1c24

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmd/devguard-cli/hashmigrations/hash_migration.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ func RunHashMigrationsIfNeeded(pool *pgxpool.Pool, daemonRunner shared.DaemonRun
9494
if err := vulndbService.ImportRC(ctx, shared.ImportOptions{}); err != nil {
9595
return fmt.Errorf("full vulndb import after hash migration failed: %w", err)
9696
}
97+
98+
// Persist the new version so this migration does not re-run on the next startup.
99+
config.Val = strconv.Itoa(CurrentHashVersion)
100+
if err := db.Save(&config).Error; err != nil {
101+
return fmt.Errorf("failed to update hash migration version after v4: %w", err)
102+
}
97103
}
98104

99105
slog.Info("Hash migrations completed successfully", "version", CurrentHashVersion)

0 commit comments

Comments
 (0)