MCPcopy Index your code
hub / github.com/dnote/dnote / InitSchema

Function InitSchema

pkg/server/database/database.go:52–62  ·  view source on GitHub ↗

InitSchema migrates database schema to reflect the latest model definition

(db *gorm.DB)

Source from the content-addressed store, hash-verified

50
51// InitSchema migrates database schema to reflect the latest model definition
52func InitSchema(db *gorm.DB) {
53 if err := db.AutoMigrate(
54 &User{},
55 &Book{},
56 &Note{},
57 &Token{},
58 &Session{},
59 ); err != nil {
60 panic(err)
61 }
62}
63
64// Open initializes the database connection
65func Open(dbPath string) *gorm.DB {

Callers 3

InitDBFunction · 0.92
InitMemoryDBFunction · 0.92
initDBFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected