replaced exists bool db scans with int for broader drivers compatibility
This commit is contained in:
@@ -762,9 +762,9 @@ func (c *Collection) updateGeneratedIdIfExists(app App) {
|
||||
|
||||
// add a number to the current id (if already exists)
|
||||
for i := 2; i < 1000; i++ {
|
||||
var exists bool
|
||||
var exists int
|
||||
_ = app.CollectionQuery().Select("(1)").AndWhere(dbx.HashExp{"id": newId}).Limit(1).Row(&exists)
|
||||
if !exists {
|
||||
if exists == 0 {
|
||||
break
|
||||
}
|
||||
newId = c.idChecksum() + strconv.Itoa(i)
|
||||
|
||||
Reference in New Issue
Block a user