fix: metadata query (#3084)

This commit is contained in:
Livio Amstutz 2022-01-21 11:30:43 +01:00 committed by GitHub
parent 3ee3b8f6d3
commit 5af7d8315d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,7 @@ func (q *Queries) SearchUserMetadata(ctx context.Context, userID string, queries
if err != nil { if err != nil {
return nil, err return nil, err
} }
metadata.LatestSequence, err = q.latestSequence(ctx, userTable) metadata.LatestSequence, err = q.latestSequence(ctx, userMetadataTable)
return metadata, err return metadata, err
} }
@ -173,7 +173,6 @@ func prepareUserMetadataListQuery() (sq.SelectBuilder, func(*sql.Rows) (*UserMet
UserMetadataValueCol.identifier(), UserMetadataValueCol.identifier(),
countColumn.identifier()). countColumn.identifier()).
From(userMetadataTable.identifier()). From(userMetadataTable.identifier()).
LeftJoin(join(HumanUserIDCol, UserIDCol)).
PlaceholderFormat(sq.Dollar), PlaceholderFormat(sq.Dollar),
func(rows *sql.Rows) (*UserMetadataList, error) { func(rows *sql.Rows) (*UserMetadataList, error) {
metadata := make([]*UserMetadata, 0) metadata := make([]*UserMetadata, 0)