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

Method Migrator

migrator.go:11–20  ·  view source on GitHub ↗

Migrator returns migrator

()

Source from the content-addressed store, hash-verified

9
10// Migrator returns migrator
11func (db *DB) Migrator() Migrator {
12 tx := db.getInstance()
13
14 // apply scopes to migrator
15 for len(tx.Statement.scopes) > 0 {
16 tx = tx.executeScopes()
17 }
18
19 return tx.Dialector.Migrator(tx.Session(&Session{}))
20}
21
22// AutoMigrate run auto migration for given models
23func (db *DB) AutoMigrate(dst ...interface{}) error {

Callers 1

AutoMigrateMethod · 0.95

Calls 4

getInstanceMethod · 0.95
executeScopesMethod · 0.80
SessionMethod · 0.80
MigratorMethod · 0.65

Tested by

no test coverage detected