Files
threshold/internal/db/schema/repair.go
shadowdaoandClaude Sonnet 5.5 962d708fdd Rename Go module paths to repo.anhonesthost.net/CyberCoveLLC/threshold
Rename root, api and sdk module paths (imports, go.mod, go_package,
ldflags, build scripts, buf configs) and regenerate protobuf/gateway
code with the project's pinned toolchain. Wire identifiers unchanged.
api gets a local replace for sdk; root/api/sdk require v0.1.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 10:33:41 -07:00

40 lines
968 B
Go

// Copyright IBM Corp. 2020, 2026
// SPDX-License-Identifier: BUSL-1.1
package schema
import "repo.anhonesthost.net/CyberCoveLLC/threshold/internal/db/schema/migration"
// RepairMigrations is a set of migration versions grouped by edition that
// should have their coresponding repair functions run if the check function
// reports an error.
type RepairMigrations map[string]map[int]bool
// IsSet checks for the existence of the given edition and version.
func (r RepairMigrations) IsSet(edition string, version int) bool {
e, ok := r[edition]
if !ok {
return false
}
_, ok = e[version]
return ok
}
// Add adds the edition and version to the set.
func (r RepairMigrations) Add(edition string, version int) {
e, ok := r[edition]
if !ok {
e = make(map[int]bool)
}
e[version] = true
r[edition] = e
}
// RepairLog represents a log entry generated by a repair function.
type RepairLog struct {
Edition string
Version int
Entry migration.Repairs
}