Skip to content

Commit

Permalink
Fix: register m2m models
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Sep 28, 2023
1 parent 58323fc commit 062a5c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/postgres/core/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func New(cfg Config, schemaName, appName string, opts ...PostgresOption) (*Postg
opt(&postgres)
}

// register many-to-many relationships
postgres.DB.RegisterModel(models.ManyToMany()...)

return &postgres, nil
}

Expand Down Expand Up @@ -125,9 +128,6 @@ func WaitNew(cfg Config, schemaName, appName string, timeout int, opts ...Postgr
time.Sleep(time.Second * time.Duration(timeout))
}

// register many-to-many relationships
db.DB.RegisterModel(models.ManyToMany()...)

return db
}

Expand Down

0 comments on commit 062a5c2

Please sign in to comment.