Versions in this module Expand all Collapse all v1 v1.0.2 Mar 19, 2021 v1.0.1 Feb 21, 2021 Changes in this version + const DBDateFormat + const DateFormat + func Refresh() error + func Register(name string, m Migrationer) error + func Reset() error + func Rollback(name string) error + func Upgrade(lasttime int64) error + type Column struct + DataType string + Default string + Inc string + Modify bool + Name string + Null string + Unsign string + func (c *Column) Remove() + func (c *Column) SetAuto(inc bool) *Column + func (c *Column) SetDataType(dataType string) *Column + func (c *Column) SetDefault(def string) *Column + func (c *Column) SetNullable(null bool) *Column + func (c *Column) SetPrimary(m *Migration) *Column + func (c *Column) SetUnsigned(unsign bool) *Column + type Foreign struct + ForeignColumn string + ForeignTable string + OnDelete string + OnUpdate string + func (foreign *Foreign) SetOnDelete(del string) *Foreign + func (foreign *Foreign) SetOnUpdate(update string) *Foreign + type Index struct + Name string + type Migration struct + Charset string + Columns []*Column + Created string + Engine string + Foreigns []*Foreign + Indexes []*Index + ModifyType string + Primary []*Column + RemoveColumns []*Column + RemoveForeigns []*Foreign + RemoveIndexes []*Index + RemoveUniques []*Unique + Renames []*RenameColumn + TableName string + Uniques []*Unique + func (m *Migration) AddColumns(columns ...*Column) *Migration + func (m *Migration) AddForeign(foreign *Foreign) *Migration + func (m *Migration) AddIndex(index *Index) *Migration + func (m *Migration) AddPrimary(primary *Column) *Migration + func (m *Migration) AddUnique(unique *Unique) *Migration + func (m *Migration) AlterTable(tablename string) + func (m *Migration) CreateTable(tablename, engine, charset string, p ...func()) + func (m *Migration) Down() + func (m *Migration) Exec(name, status string) error + func (m *Migration) ForeignCol(colname, foreigncol, foreigntable string) (foreign *Foreign) + func (m *Migration) GetCreated() int64 + func (m *Migration) GetSQL() (sql string) + func (m *Migration) Migrate(migrationType string) + func (m *Migration) NewCol(name string) *Column + func (m *Migration) PriCol(name string) *Column + func (m *Migration) RenameColumn(from, to string) *RenameColumn + func (m *Migration) Reset() + func (m *Migration) SQL(sql string) + func (m *Migration) UniCol(uni, name string) *Column + func (m *Migration) Up() + type Migrationer interface + Down func() + Exec func(name, status string) error + GetCreated func() int64 + Reset func() + Up func() + type RenameColumn struct + NewName string + OldDataType string + OldDefault string + OldName string + OldNull string + OldUnsign string + func (c *RenameColumn) SetOldDataType(dataType string) *RenameColumn + func (c *RenameColumn) SetOldDefault(def string) *RenameColumn + func (c *RenameColumn) SetOldNullable(null bool) *RenameColumn + func (c *RenameColumn) SetOldUnsigned(unsign bool) *RenameColumn + type Unique struct + Columns []*Column + Definition string + func (unique *Unique) AddColumnsToUnique(columns ...*Column) *Unique