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:
Simon Frei
2026-06-04 18:28:19 +00:00
committed by GitHub
co-authored by Marcus B Spencer Jakob Borg
parent 6df85dc95c
commit e16b8013a6
6 changed files with 107 additions and 1 deletions
+7
View File
@@ -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(`