Documentation ¶
Index ¶
- Constants
- func PrintTree(root *OperationsNode, blank string)
- func ShowTree(root *OperationsNode)
- type ActionType
- type Args
- type Field
- type Index
- type Migrate
- func (m *Migrate) Applied() map[string]int
- func (m *Migrate) AppliedOrdered() []string
- func (m *Migrate) DownGrade(version string)
- func (m *Migrate) Fake(version string)
- func (m *Migrate) GetOperations() []*Operations
- func (m *Migrate) GetOperationsTree(withValid bool) *OperationsNode
- func (m *Migrate) HeadToString(root *OperationsNode) []string
- func (m *Migrate) Heads(root *OperationsNode, ret map[string]int)
- func (m *Migrate) List()
- func (m *Migrate) MakeMigrations()
- func (m *Migrate) Merge()
- func (m *Migrate) Migrate()
- func (m *Migrate) MigrationsEnd(fn string, latest []string) string
- func (m *Migrate) MigrationsInit()
- func (m *Migrate) MigrationsMergeContent(fn string, heads []string) string
- func (m *Migrate) MigrationsPath() string
- func (m *Migrate) MigrationsPre(fn string) string
- func (m *Migrate) ModelsPath() string
- func (*Migrate) RootPath() (string, error)
- func (m *Migrate) Run()
- func (m *Migrate) UnApplied() []*Operations
- func (m *Migrate) Valid(root *OperationsNode)
- type Operation
- type OperationSlice
- type Operations
- type OperationsNode
- type OrmMigrations
- type Table
Constants ¶
View Source
const ( INITMigrations = "" MIGRATIONSplit = "_" MIGRATIONPath = "/migrations/" INITContent = "package migrations\n\ntype Migrations struct{}\n" )
View Source
const ( TIMEFormat = "20060102150405" NORMALTimeFormat = "2006-01-02 15:04:05" )
View Source
const ( ADDIndexStr = "core.ADDIndex" DELETEIndexStr = "core.DELETEIndex" ADDUniqueIndexStr = "core.ADDUniqueIndex" DELETEUniqueIndexStr = "core.DELETEUniqueIndex" )
View Source
const (
APPLIED = 1
)
View Source
const PACKAGEPATH = "github.com/lhypj/gorm-migrate/core"
Variables ¶
This section is empty.
Functions ¶
func PrintTree ¶
func PrintTree(root *OperationsNode, blank string)
func ShowTree ¶
func ShowTree(root *OperationsNode)
Types ¶
type ActionType ¶
type ActionType uint8
const ( ADDField ActionType = iota DELETEField ALTERField ADDTable DELETETable ADDIndex DELETEIndex ADDUniqueIndex DELETEUniqueIndex )
type Migrate ¶
type Migrate struct { DB *gorm.DB PackagePath string ModelsRelativePath string Migrations interface{} Models []interface{} }
func (*Migrate) AppliedOrdered ¶
func (*Migrate) GetOperations ¶
func (m *Migrate) GetOperations() []*Operations
func (*Migrate) GetOperationsTree ¶
func (m *Migrate) GetOperationsTree(withValid bool) *OperationsNode
func (*Migrate) HeadToString ¶
func (m *Migrate) HeadToString(root *OperationsNode) []string
func (*Migrate) MakeMigrations ¶
func (m *Migrate) MakeMigrations()
func (*Migrate) MigrationsInit ¶
func (m *Migrate) MigrationsInit()
func (*Migrate) MigrationsMergeContent ¶
func (*Migrate) MigrationsPath ¶
func (*Migrate) MigrationsPre ¶
func (*Migrate) ModelsPath ¶
func (*Migrate) UnApplied ¶
func (m *Migrate) UnApplied() []*Operations
func (*Migrate) Valid ¶
func (m *Migrate) Valid(root *OperationsNode)
type OperationSlice ¶
type OperationSlice []*Operations
func (OperationSlice) Len ¶
func (ops OperationSlice) Len() int
func (OperationSlice) Less ¶
func (ops OperationSlice) Less(i, j int) bool
func (OperationSlice) Swap ¶
func (ops OperationSlice) Swap(i, j int)
type Operations ¶
type OperationsNode ¶
type OperationsNode struct { Ops *Operations Children []*OperationsNode }
func GenerateOperationsTree ¶
func GenerateOperationsTree(operations *[]*Operations) *OperationsNode
func GenerateTree ¶
func GenerateTree(m map[string]*Operations, children map[string][]*Operations, revision string) *OperationsNode
func (*OperationsNode) GetTable ¶
func (root *OperationsNode) GetTable() map[string]*Table
func (*OperationsNode) IsRoot ¶
func (n *OperationsNode) IsRoot() bool
type OrmMigrations ¶
Click to show internal directories.
Click to hide internal directories.