Skip to content

Commit

Permalink
refactor(db): fix migrations by fetching missing core registered mode…
Browse files Browse the repository at this point in the history
…ls as well and merging
  • Loading branch information
pcfreak30 committed Dec 22, 2024
1 parent d84b2ae commit 6f77556
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions db_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
clientv3 "go.etcd.io/etcd/client/v3"
"go.lumeweb.com/portal/core"
dbModels "go.lumeweb.com/portal/db/models"
"go.uber.org/zap"
"gorm.io/gorm"
"reflect"
Expand Down Expand Up @@ -109,6 +110,8 @@ func (m *MigrationManager) executeMigrations(db *gorm.DB) error {
return err
}

models = append(models, dbModels.GetModels()...)

for _, model := range models {
typ := reflect.TypeOf(model)
// Get the underlying type if it's a pointer
Expand Down

0 comments on commit 6f77556

Please sign in to comment.