MCPcopy Create free account
hub / github.com/apache/devlake / AutoMigrate

Method AutoMigrate

backend/impls/dalgorm/dalgorm.go:176–184  ·  view source on GitHub ↗

AutoMigrate runs auto migration for given models

(entity interface{}, clauses ...dal.Clause)

Source from the content-addressed store, hash-verified

174
175// AutoMigrate runs auto migration for given models
176func (d *Dalgorm) AutoMigrate(entity interface{}, clauses ...dal.Clause) errors.Error {
177 d.unwrapDynamic(&entity, &clauses)
178 err := buildTx(d.db, clauses).AutoMigrate(entity)
179 if err == nil {
180 // fix pg cache plan error
181 _ = d.First(entity, clauses...)
182 }
183 return d.convertGormError(err)
184}
185
186// Cursor returns a database cursor, cursor is especially useful when handling big amount of rows of data
187func (d *Dalgorm) Cursor(clauses ...dal.Clause) (dal.Rows, errors.Error) {

Callers

nothing calls this directly

Calls 5

unwrapDynamicMethod · 0.95
FirstMethod · 0.95
convertGormErrorMethod · 0.95
buildTxFunction · 0.85
AutoMigrateMethod · 0.65

Tested by

no test coverage detected