Documentation
¶
Index ¶
- func FormatPlan(plan PlanResult) string
- type ApplyOptions
- type ManualOptions
- type Migrator
- func (m *Migrator) AutoMigrate(ctx context.Context, models ...any) error
- func (m *Migrator) AutoMigrateWithOptions(ctx context.Context, opts ApplyOptions, models ...any) error
- func (m *Migrator) MigrateDownDir(ctx context.Context, dir string, steps int) error
- func (m *Migrator) MigrateUpDir(ctx context.Context, dir string) error
- func (m *Migrator) Plan(ctx context.Context, models ...any) (PlanResult, error)
- func (m *Migrator) SetManualOptions(opts ManualOptions)
- type PlanResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatPlan ¶
func FormatPlan(plan PlanResult) string
FormatPlan returns a human-friendly summary grouped by table and severity.
Types ¶
type ApplyOptions ¶
ApplyOptions controls execution of destructive statements
type ManualOptions ¶
type ManualOptions struct { AllowTableDrop bool // allow DROP TABLE in down migrations AllowColumnDrop bool // allow ALTER TABLE ... DROP COLUMN in down migrations }
ManualOptions controls safety gates for manual file-based migrations
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator handles migrations and schema management
func NewMigrator ¶
func (*Migrator) AutoMigrate ¶
AutoMigrate is a placeholder implementation
func (*Migrator) AutoMigrateWithOptions ¶
func (m *Migrator) AutoMigrateWithOptions(ctx context.Context, opts ApplyOptions, models ...any) error
AutoMigrateWithOptions applies plan with additional options (e.g., allow drops)
func (*Migrator) MigrateDownDir ¶
MigrateDownDir rolls back the last N applied migrations using .down.sql files
func (*Migrator) MigrateUpDir ¶
MigrateUpDir applies pending .up.sql migrations from dir in ascending version order
func (*Migrator) SetManualOptions ¶
func (m *Migrator) SetManualOptions(opts ManualOptions)
SetManualOptions sets safety options for manual migrations
Click to show internal directories.
Click to hide internal directories.