From c38e05cfa01303335084972ea6f6ebd623e01b66 Mon Sep 17 00:00:00 2001 From: yoshnopa <40072150+yoshnopa@users.noreply.github.com> Date: Sat, 2 Sep 2023 00:57:40 +0200 Subject: [PATCH] Allow empty values for because of isnull and isnotnull (#4078) * Allow empty values for because of isnull and isnotnull * Add float64 to the values just passed through --- pkg/sqlite/migrations/49_postmigrate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/sqlite/migrations/49_postmigrate.go b/pkg/sqlite/migrations/49_postmigrate.go index d500d4707..941cf6a88 100644 --- a/pkg/sqlite/migrations/49_postmigrate.go +++ b/pkg/sqlite/migrations/49_postmigrate.go @@ -352,6 +352,8 @@ func (m *schema49Migrator) adjustCriterionValue(value interface{}, typ string) ( return value, nil } else if _, ok := value.(int); ok { return value, nil + } else if _, ok := value.(float64); ok { + return value, nil } return nil, fmt.Errorf("could not recognize format of value %v", value) @@ -392,7 +394,7 @@ func (m *schema49Migrator) adjustCriterionItem(value interface{}) (interface{}, // Converts a value of type string to its according type, given by string func (m *schema49Migrator) convertValue(value interface{}, typ string) (interface{}, error) { valueType := reflect.TypeOf(value).Name() - if typ == valueType || (typ == "int" && valueType == "float64") || (typ == "float64" && valueType == "int") { + if typ == valueType || (typ == "int" && valueType == "float64") || (typ == "float64" && valueType == "int") || value == "" { return value, nil }