chore(db, model): separate methods to drop a device vs its files (#10480)
Fixes #10469 --------- Signed-off-by: Simon Frei <freisim93@gmail.com> Signed-off-by: Jakob Borg <jakob@kastelo.net> Co-authored-by: Marcus B Spencer <marcus@marcusspencer.us> Co-authored-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
co-authored by
Marcus B Spencer
Jakob Borg
parent
6df85dc95c
commit
e16b8013a6
@@ -235,6 +235,13 @@ func (s *folderDB) DropAllFiles(device protocol.DeviceID) error {
|
||||
defer tx.Rollback() //nolint:errcheck
|
||||
txp := &txPreparedStmts{Tx: tx}
|
||||
|
||||
if _, err := tx.Exec(`
|
||||
UPDATE indexids SET sequence = 0
|
||||
WHERE device_idx = ?
|
||||
`, deviceIdx); err != nil {
|
||||
return wrap(err)
|
||||
}
|
||||
|
||||
// Drop all the file entries
|
||||
|
||||
result, err := tx.Exec(`
|
||||
|
||||
Reference in New Issue
Block a user