session_item.item_id is polymorphic (no FK), so deleting an exercise or
combo used in a session left orphaned rows that the INNER JOIN in
getItems silently hid. Exercise/combo deletes now also remove their
session_item rows in one transaction. Delete confirmations on the
exercise/combo/session detail views now include usage counts (sessions/
combos using an exercise, sessions using a combo, collections containing
a session) via new count helpers and deleteConfirmUsage keys (EN/FR/DA).
Confirm stays informative, not blocking, consistent with the existing
history warning.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The 5 sequential UPDATEs could half-rename the database if a renamed
title collided with an existing one (UNIQUE constraint) mid-way. They
now go through db.batch(), which rolls back on error. SettingsView
shows a translated error (new import.suffixRenameFailed key, EN/FR/DA)
instead of the raw constraint message. Test seeds a colliding title and
asserts the rename fails with nothing renamed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>