Skip to content

Commit

Permalink
Disable automigration
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Dec 8, 2023
1 parent 55efbbb commit dae1015
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions api/pkg/di/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ func (container *Container) DedicatedDB() (db *gorm.DB) {
}

container.logger.Debug(fmt.Sprintf("Running migrations for yugabyte [%T]", db))
if err = db.AutoMigrate(&entities.Heartbeat{}); err != nil {
container.logger.Fatal(stacktrace.Propagate(err, fmt.Sprintf("cannot migrate %T", &entities.Heartbeat{})))
}

if err = db.AutoMigrate(&entities.HeartbeatMonitor{}); err != nil {
container.logger.Fatal(stacktrace.Propagate(err, fmt.Sprintf("cannot migrate %T", &entities.HeartbeatMonitor{})))
}
//if err = db.AutoMigrate(&entities.Heartbeat{}); err != nil {
// container.logger.Fatal(stacktrace.Propagate(err, fmt.Sprintf("cannot migrate %T", &entities.Heartbeat{})))
//}
//
//if err = db.AutoMigrate(&entities.HeartbeatMonitor{}); err != nil {
// container.logger.Fatal(stacktrace.Propagate(err, fmt.Sprintf("cannot migrate %T", &entities.HeartbeatMonitor{})))
//}

container.dedicatedDB = db
return container.dedicatedDB
Expand Down

0 comments on commit dae1015

Please sign in to comment.