Versions in this module Expand all Collapse all v1 v1.0.0 Sep 19, 2023 Changes in this version + const LowerRestoreFlag + const UppercaseRestoreFlag + type Column struct + Comment string + LiteType *sqlite.Type + MysqlType *types.FieldType + Options []*ast.ColumnOption + PgType *ptypes.T + func (c Column) GetType() byte + func (c Column) HasDefaultValue() bool + type ForeignKey struct + Column string + Constraint string + RefColumn string + RefTable string + Table string + type Index struct + CnsTyp ast.ConstraintType + Columns []string + IndexType model.IndexType + Typ ast.IndexKeyType + type MigrateAction int8 + const MigrateAddAction + const MigrateModifyAction + const MigrateNoAction + const MigrateRemoveAction + const MigrateRenameAction + type Migration struct + Tables []Table + func NewMigration(dialect sql_templates.SqlDialect, lowercase bool) Migration + func (m *Migration) AddColumn(tbName string, col Column) + func (m *Migration) AddForeignKey(tbName string, fk ForeignKey) + func (m *Migration) AddIndex(tbName string, idx Index) + func (m *Migration) AddTable(tb Table) + func (m *Migration) Diff(old Migration) + func (m *Migration) RemoveColumn(tbName, colName string) + func (m *Migration) RemoveForeignKey(tbName, fkName string) + func (m *Migration) RemoveIndex(tbName, idxName string) + func (m *Migration) RemoveTable(tbName string) + func (m *Migration) RenameColumn(tbName, oldName, newName string) + func (m *Migration) RenameIndex(tbName, oldName, newName string) + func (m *Migration) RenameTable(oldName, newName string) + func (m *Migration) SetColumnPosition(tbName string, pos *ast.ColumnPosition) + func (m *Migration) Using(tbName string) + func (m Migration) HashValue() int64 + func (m Migration) MigrationDown() string + func (m Migration) MigrationUp() string + type Node struct + Action MigrateAction + Name string + OldName string + type Table struct + Columns []Column + ForeignKeys []ForeignKey + Indexes []Index + func NewTable(name string) *Table + func NewTableWithAction(name string, action MigrateAction) *Table + func (t *Table) AddColumn(col Column) + func (t *Table) AddForeignKey(fk ForeignKey) + func (t *Table) AddIndex(idx Index) + func (t *Table) Arrange() + func (t *Table) Diff(old Table) + func (t *Table) RemoveForeignKey(fkName string) + func (t *Table) RemoveIndex(idxName string) + func (t *Table) RenameColumn(oldName, newName string) + func (t *Table) RenameIndex(oldName, newName string) + func (t Table) MigrationColumnDown() ([]string, map[string]struct{}) + func (t Table) MigrationColumnUp() ([]string, map[string]struct{}) + func (t Table) MigrationForeignKeyDown(dropCols map[string]struct{}) []string + func (t Table) MigrationForeignKeyUp(dropCols map[string]struct{}) []string + func (t Table) MigrationIndexDown(dropCols map[string]struct{}) []string + func (t Table) MigrationIndexUp(dropCols map[string]struct{}) []string