Skip to content

Commit

Permalink
fix gorm query for postgres
Browse files Browse the repository at this point in the history
Signed-off-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
kradalby committed Jul 16, 2024
1 parent efd7964 commit 48731c2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions hscontrol/db/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,9 @@ func ListNodes(tx *gorm.DB) (types.Nodes, error) {
func (hsdb *HSDatabase) ListEphemeralNodes() (types.Nodes, error) {
return Read(hsdb.DB, func(rx *gorm.DB) (types.Nodes, error) {
nodes := types.Nodes{}
if err := rx.Debug().Joins("AuthKey").Where("AuthKey.ephemeral = true").Find(&nodes).Error; err != nil {
if err := rx.Joins("AuthKey").Where(`"AuthKey"."ephemeral" = true`).Find(&nodes).Error; err != nil {
return nil, err
}
// if err := rx.Debug().Preload("AuthKey", "ephemeral = 1").Find(&nodes).Error; err != nil {
// return nil, err
// }

return nodes, nil
})
Expand Down

0 comments on commit 48731c2

Please sign in to comment.