3
0

Fix unique value checking query

This commit is contained in:
Denis Arh
2020-02-25 08:14:06 +01:00
parent a78235252f
commit db601523a6
+2 -2
View File
@@ -336,14 +336,14 @@ func (r record) PartialUpdateValues(rvs ...*types.RecordValue) (err error) {
func (r record) RefValueLookup(moduleID uint64, field string, ref uint64) (recordID uint64, err error) {
var sql = "SELECT record_id" +
" FROM compose_record AS r INNER JOIN compose_record_value AS v " +
" WHERE rel_module = ? " +
" WHERE r.module_id = ? " +
" AND v.name = ? " +
" AND v.ref = ? " +
" AND r.deleted_at IS NULL " +
" AND v.deleted_at IS NULL " +
" LIMIT 1"
return recordID, r.db().Get(recordID, sql, moduleID, field, ref)
return recordID, r.db().Get(&recordID, sql, moduleID, field, ref)
}
func (r record) LoadValues(fieldNames []string, IDs []uint64) (rvs types.RecordValueSet, err error) {