test: adjust restart count after cascade delete
This commit is contained in:
@@ -733,6 +733,14 @@ function listFootprints(d, query) {
|
||||
d.prepare("INSERT INTO footprint_fts(footprint_fts, rowid, search_text) SELECT 'delete', id, search_text FROM footprint WHERE id=?")
|
||||
.run(payload.id);
|
||||
softDelete(d, 'footprint', payload.id);
|
||||
// 级联清理附件:墓碑(同步到其他端)+ 磁盘原图/缩略图
|
||||
const atts = d.prepare("SELECT * FROM attachment WHERE owner_type='footprint' AND owner_id=? AND deleted_at IS NULL").all(payload.id);
|
||||
for (const a of atts) {
|
||||
softDelete(d, 'attachment', a.id);
|
||||
for (const rel of [a.rel_path, a.thumb_rel_path]) {
|
||||
if (rel) { try { fs.unlinkSync(path.join(DATA_DIR, rel)); } catch {} }
|
||||
}
|
||||
}
|
||||
});
|
||||
return { ok: true };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user