Fix the issue that database syncer can't work with null-fields on source table

This commit is contained in:
Yang Luo
2023-09-12 16:06:44 +08:00
parent dc57c476b7
commit 0fe34c2f53
2 changed files with 8 additions and 6 deletions

View File

@ -15,6 +15,7 @@
package object
import (
"database/sql"
"fmt"
"strings"
"time"
@ -31,7 +32,7 @@ type Credential struct {
}
func (syncer *Syncer) getOriginalUsers() ([]*OriginalUser, error) {
var results []map[string]string
var results []map[string]sql.NullString
err := syncer.Ormer.Engine.Table(syncer.getTable()).Find(&results)
if err != nil {
return nil, err