-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
I am trying to update several rows and on version 0.11.3 works fine but on version 0.11.4 do not work properly and said this: "ORDER BY without LIMIT on UPDATE (code: 1)".
The code when exactly said that are this:
try connection.run(rowsToUpdate.update(tListOfSongs.position++))
.
Whew tListOfSongs are:
private struct ListOfSongs{
let table = Table("ListOfSongs")
let id = Expression<Int64>("id")
let listId = Expression<Int64>("listId")
let songId = Expression<Int64>("songId")
let position = Expression<Int>("position")
let date = Expression<Date>("listDate")
}
And the exactly code are:
do{
let rowsToUpdate = tListOfSongs.table.filter(tListOfSongs.position < originalPos && tListOfSongs.position >= movePos && tListOfSongs.listId == listId).order(tListOfSongs.position.desc)
try connection.run(rowsToUpdate.update(tListOfSongs.position++))
}catch{ print("ERROR:") print("ERROR TRYING TO MOVE SONGS POSITION FROM LIST: \(error)") }
I think that it does not a code error inasmuch as on version 0.11.3 works fine and i checked that there is at least one row to update.
Need Help Please.