mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
models migrated and data insert success with dbeaver
This commit is contained in:
+12
-1
@@ -40,8 +40,19 @@ func InitDB(shouldMigrate bool) *gorm.DB {
|
||||
if err := db.AutoMigrate(&models.APIKey{}); err != nil {
|
||||
log.Fatalf("migrate APIKey: %v", err)
|
||||
}
|
||||
// Game Models
|
||||
if err := db.AutoMigrate(
|
||||
&models.Game{},
|
||||
&models.LineScore{},
|
||||
&models.PlayerGameBasicStat{},
|
||||
&models.PlayerGameAdvStat{},
|
||||
&models.TeamGameBasicStat{},
|
||||
&models.TeamGameAdvStat{},
|
||||
); err != nil {
|
||||
log.Fatalf("migrate game models: %v", err)
|
||||
}
|
||||
metrics.DBOperationsTotal.WithLabelValues("migrate", "database").Inc()
|
||||
}
|
||||
|
||||
return db
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user