MCPcopy
hub / github.com/go-gorm/gorm / Migrator

Interface Migrator

migrator.go:68–111  ·  migrator.go::Migrator

Migrator migrator interface

Source from the content-addressed store, hash-verified

66
67// Migrator migrator interface
68type Migrator interface {
69 // AutoMigrate
70 AutoMigrate(dst ...interface{}) error
71
72 // Database
73 CurrentDatabase() string
74 FullDataTypeOf(*schema.Field) clause.Expr
75 GetTypeAliases(databaseTypeName string) []string
76
77 // Tables
78 CreateTable(dst ...interface{}) error
79 DropTable(dst ...interface{}) error
80 HasTable(dst interface{}) bool
81 RenameTable(oldName, newName interface{}) error
82 GetTables() (tableList []string, err error)
83 TableType(dst interface{}) (TableType, error)
84
85 // Columns
86 AddColumn(dst interface{}, field string) error
87 DropColumn(dst interface{}, field string) error
88 AlterColumn(dst interface{}, field string) error
89 MigrateColumn(dst interface{}, field *schema.Field, columnType ColumnType) error
90 // MigrateColumnUnique migrate column's UNIQUE constraint, it's part of MigrateColumn.
91 MigrateColumnUnique(dst interface{}, field *schema.Field, columnType ColumnType) error
92 HasColumn(dst interface{}, field string) bool
93 RenameColumn(dst interface{}, oldName, field string) error
94 ColumnTypes(dst interface{}) ([]ColumnType, error)
95
96 // Views
97 CreateView(name string, option ViewOption) error
98 DropView(name string) error
99
100 // Constraints
101 CreateConstraint(dst interface{}, name string) error
102 DropConstraint(dst interface{}, name string) error
103 HasConstraint(dst interface{}, name string) bool
104
105 // Indexes
106 CreateIndex(dst interface{}, name string) error
107 DropIndex(dst interface{}, name string) error
108 HasIndex(dst interface{}, name string) bool
109 RenameIndex(dst interface{}, oldName, newName string) error
110 GetIndexes(dst interface{}) ([]Index, error)
111}

Callers 111

AutoMigrateMethod · 0.65
TestMigrateFunction · 0.65
TestAutoMigrateNullableFunction · 0.65
HasTableMethod · 0.65
HasColumnMethod · 0.65
HasConstraintMethod · 0.65
HasIndexMethod · 0.65

Implementers 1

Migratormigrator/migrator.go

Calls

no outgoing calls

Tested by

no test coverage detected