Remove dependency on postgres' jsonb

This commit is contained in:
Juan Font Alonso 2021-05-15 00:05:41 +02:00
parent e7a626d3cc
commit e0d916bb5a
4 changed files with 17 additions and 17 deletions

View file

@ -5,7 +5,7 @@ import (
"errors"
"log"
"github.com/jinzhu/gorm/dialects/postgres"
"gorm.io/datatypes"
"inet.af/netaddr"
)
@ -49,7 +49,7 @@ func (h *Headscale) EnableNodeRoute(namespace string, nodeName string, routeStr
}
routes, _ := json.Marshal([]string{routeStr}) // TODO: only one for the time being, so overwriting the rest
m.EnabledRoutes = postgres.Jsonb{RawMessage: json.RawMessage(routes)}
m.EnabledRoutes = datatypes.JSON(routes)
db.Save(&m)
db.Close()