feat(service-storage-harness): slice 4 — cascade-delete wiring + integration test
Wire ServiceDataHarness.cascade_delete into SettingsStore.delete_service (best-effort try/except, logs on failure). Fix migration runner to also catch 'no such table' on fresh DBs (ALTER TABLE before init_schema). Integration test proves end-to-end cascade across both concerns (qBit samples + media items) with multi-instance preservation. Backend: 322 pytest pass, ruff clean.
This commit is contained in:
@@ -95,8 +95,9 @@ class ServiceDataHarness:
|
||||
try:
|
||||
conn.execute(stmt)
|
||||
except sqlite3.OperationalError as exc:
|
||||
if "duplicate column name" in str(exc).lower():
|
||||
logger.debug("Skipping already-applied migration: %s", stmt[:80])
|
||||
lowered = str(exc).lower()
|
||||
if "duplicate column name" in lowered or "no such table" in lowered:
|
||||
logger.debug("Skipping migration (already applied or table absent): %s", stmt[:80])
|
||||
else:
|
||||
raise
|
||||
conn.commit()
|
||||
|
||||
Reference in New Issue
Block a user