Repository navigation
goodm v0.6.0
Fixed
Enforcenow verifies the options of existing indexes instead of accepting any index by name alone. Agoodm:"unique"field whose existing index is non-unique, sparse, or partial (and the reverse: a plainindexfield with a unique index) is reported as anEnforcementErrorby default. The same check applies to compound indexes. Previously such mismatches were silently skipped, souniquetags guaranteed nothing once any index of that name existed (MSA-76 / BUG-3136).
Added
EnforceOptions.IndexMismatchPolicy:IndexMismatchError(default, fail loudly),IndexMismatchRebuild(drop and recreate mismatched indexes; refuses to drop when rebuilding a unique index over duplicate data), andIndexMismatchIgnore(legacy name-only behavior).IndexSpectype describing an existing index (keys, unique, sparse, partial).
Changed
- Breaking:
ListExistingIndexesnow returnsmap[string]IndexSpecinstead ofmap[string]bool.
Upgrade note
The default policy is now IndexMismatchError, so services whose databases already have drifted indexes will fail at boot with a descriptive EnforcementError until the index is rebuilt (or IndexMismatchRebuild/IndexMismatchIgnore is set). This loud failure is the point of the fix — the previous behavior silently left unique constraints unenforced.