Versions in this module Expand all Collapse all v0 v0.1.1 Oct 15, 2019 v0.1.0 Sep 29, 2019 Changes in this version + var FileNameRegex = regexp.MustCompile(`^([0-9]{4})_\w+\.json$`) + var Migration = gomodel.New("Migration", gomodel.Fields{ ... }, gomodel.Options{}) + var NodeNameRegex = regexp.MustCompile(`^([0-9]{4})_\w+$`) + func MakeAndRun(database string) error + func RegisterOperation(op Operation) error + func Run(options RunOptions) error + type AddFields struct + Fields gomodel.Fields + Model string + func (op AddFields) Backwards(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op AddFields) OpName() string + func (op AddFields) Run(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op AddFields) SetState(state *AppState) error + type AddIndex struct + Fields []string + Model string + Name string + func (op AddIndex) Backwards(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op AddIndex) OpName() string + func (op AddIndex) Run(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op AddIndex) SetState(state *AppState) error + type AppNotFoundError struct + Name string + Trace ErrorTrace + func (e *AppNotFoundError) Error() string + type AppState struct + Models map[string]*gomodel.Model + func Make(appName string, options MakeOptions) (*AppState, error) + func (state *AppState) MakeMigrations() ([]*Node, error) + func (state AppState) Fake(database string, nodeName string) error + func (state AppState) Migrate(database string, nodeName string) error + type CircularDependencyError struct + Trace ErrorTrace + func (e *CircularDependencyError) Error() string + type CreateModel struct + Fields gomodel.Fields + Name string + Table string + func (op CreateModel) Backwards(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op CreateModel) OpName() string + func (op CreateModel) Run(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op CreateModel) SetState(state *AppState) error + type DeleteModel struct + Name string + func (op DeleteModel) Backwards(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op DeleteModel) OpName() string + func (op DeleteModel) Run(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op DeleteModel) SetState(state *AppState) error + type DuplicateNumberError struct + Trace ErrorTrace + func (e *DuplicateNumberError) Error() string + type ErrorTrace struct + Err error + Node *Node + Operation Operation + func (e ErrorTrace) String() string + type InvalidDependencyError struct + Trace ErrorTrace + func (e *InvalidDependencyError) Error() string + type LoadError struct + Trace ErrorTrace + func (e *LoadError) Error() string + type MakeOptions struct + Empty bool + OmitWrite bool + type NameError struct + Name string + Trace ErrorTrace + func (e *NameError) Error() string + type NoAppMigrationsError struct + Name string + Trace ErrorTrace + func (e *NoAppMigrationsError) Error() string + type Node struct + App string + Dependencies [][]string + Operations OperationList + func (n *Node) Backwards(db gomodel.Database) error + func (n *Node) Fake(db gomodel.Database) error + func (n *Node) FakeBackwards(db gomodel.Database) error + func (n *Node) Load() error + func (n *Node) Run(db gomodel.Database) error + func (n Node) Name() string + func (n Node) Save() error + type Operation interface + Backwards func(engine gomodel.Engine, state *AppState, prevState *AppState) error + OpName func() string + Run func(engine gomodel.Engine, state *AppState, prevState *AppState) error + SetState func(state *AppState) error + type OperationList []Operation + func (opList *OperationList) UnmarshalJSON(data []byte) error + func (opList OperationList) MarshalJSON() ([]byte, error) + type OperationRunError struct + Trace ErrorTrace + func (e *OperationRunError) Error() string + type OperationStateError struct + Trace ErrorTrace + func (e *OperationStateError) Error() string + type PathError struct + App string + Trace ErrorTrace + func (e *PathError) Error() string + type RemoveFields struct + Fields []string + Model string + func (op RemoveFields) Backwards(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op RemoveFields) OpName() string + func (op RemoveFields) Run(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op RemoveFields) SetState(state *AppState) error + type RemoveIndex struct + Model string + Name string + func (op RemoveIndex) Backwards(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op RemoveIndex) OpName() string + func (op RemoveIndex) Run(engine gomodel.Engine, state *AppState, prevState *AppState) error + func (op RemoveIndex) SetState(state *AppState) error + type RunOptions struct + App string + Database string + Fake bool + Node string + type SaveError struct + Trace ErrorTrace + func (e *SaveError) Error() string