Documentation
¶
Overview ¶
Package schemadiff compares canonical manifests for migration intent that cannot be inferred safely from a database schema alone.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RenameCandidate ¶
type RenameCandidate struct {
Kind RenameKind
BeforeCollection schema.Collection
AfterCollection schema.Collection
BeforeField *schema.Field
AfterField *schema.Field
Fields []FieldPair
}
RenameCandidate is an unambiguous structural match that still requires explicit human confirmation before migration SQL may preserve its data.
func RenameCandidates ¶
func RenameCandidates(before, after schema.Manifest) []RenameCandidate
RenameCandidates returns only one-to-one, shape-compatible collection and recursively nested field matches. Ambiguous matches are deliberately omitted.
func RenameCandidatesWithCollectionMapping ¶
func RenameCandidatesWithCollectionMapping(before, after schema.Manifest, collectionMapping map[schema.StableID]schema.StableID) []RenameCandidate
RenameCandidatesWithCollectionMapping normalizes references in the before manifest through simultaneously confirmed collection identities. It is used to replay immutable multi-rename artifacts where an owner and one of its relationship or upload targets move in the same transaction. Every mapped collection must still match its own unique structural rename candidate.
type RenameKind ¶
type RenameKind string
RenameKind identifies the kind of schema address that may have changed.
const ( RenameCollection RenameKind = "collection" RenameField RenameKind = "field" )