MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / Init

Function Init

internal/db/db.go:13–19  ·  view source on GitHub ↗
(d *gorm.DB)

Source from the content-addressed store, hash-verified

11var db *gorm.DB
12
13func Init(d *gorm.DB) {
14 db = d
15 err := AutoMigrate(new(model.Storage), new(model.User), new(model.Meta), new(model.SettingItem), new(model.SearchNode), new(model.TaskItem), new(model.SSHPublicKey), new(model.SharingDB))
16 if err != nil {
17 log.Fatalf("failed migrate database: %s", err.Error())
18 }
19}
20
21func AutoMigrate(dst ...interface{}) error {
22 var err error

Callers 2

initFunction · 0.92
InitDBFunction · 0.92

Calls 2

AutoMigrateFunction · 0.85
ErrorMethod · 0.45

Tested by 1

initFunction · 0.74