Documentation
¶
Index ¶
- func ContainsDestructiveChange(sql string) bool
- func DestructiveWarning(changes []string) string
- func Diff(cfg Config, name string, force bool) (string, error)
- func Down(cfg Config) (string, error)
- func FindDestructiveChanges(sql string) []string
- func Hash(cfg Config) error
- func Status(cfg Config) (string, error)
- func Up(cfg Config) (string, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsDestructiveChange ¶
ContainsDestructiveChange checks if SQL contains any destructive operations.
func DestructiveWarning ¶
DestructiveWarning generates a formatted warning message for destructive changes.
func Diff ¶
Diff generates a new migration by comparing the current schema with the target schema. If force is false and the migration contains destructive changes, returns an error.
func FindDestructiveChanges ¶
FindDestructiveChanges returns all lines containing destructive operations.
Types ¶
type Config ¶
type Config struct {
AtlasBin string // Path to atlas binary
MigrationDir string // Path to migrations/ directory
SchemaURL string // Path to gen/atlas/schema.hcl (file:// URL)
DatabaseURL string // PostgreSQL connection URL
DevURL string // Dev database URL for atlas diff
}
Config holds the configuration for Atlas CLI commands.
Click to show internal directories.
Click to hide internal directories.