@ -59,6 +59,7 @@ func main() {
config.Database.Name,
config.Database.Port)))
case "sqlite":
fallthrough
default:
db, _ = gorm.Open(sqlite.Open(config.Database.File), &gorm.Config{})
}
@ -270,7 +270,7 @@ func (m *usersServer) SetRoles(ctx context.Context, in *proto.SetRolesRequest) (
var r models.Role
for _, x := range in.Roles {
if tx := m.db.First(&r, "id = ?", x.Id); tx.RowsAffected != 0 {
u.Roles = append(u.Roles, r)
u.Roles = append(u.Roles, &r)