Documentation
¶
Overview ¶
Package schema compares a complete application schema with its database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct {
Action string `json:"action"`
Table string `json:"table"`
Name string `json:"name,omitempty"`
Before string `json:"before,omitempty"`
After string `json:"after,omitempty"`
Risk bool `json:"risk"`
}
Change describes one planned operation. Risk marks operations that can affect data.
type Definition ¶
Definition is the complete database target. Tables absent from it are dropped. Keep contains runtime-owned table patterns, not a boundary for business tables.
func Resolve ¶
func Resolve() *Definition
Resolve returns the current application target, including business customizations.
func (*Definition) Apply ¶
Apply executes the reviewed plan. On failure it returns the precise operation. MySQL DDL may already have committed earlier operations; recheck before retrying.
func (*Definition) Check ¶
Check compares all tables; an optional selection limits this invocation only.