towerops/priv
Graham McIntire a230f1bfb5
fix: prevent silent data loss from cascade deletes on agent tokens
Changed foreign key constraints from CASCADE to RESTRICT for:
- agent_tokens.organization_id
- agent_assignments.agent_token_id

**Problem:**
Deleting an organization would cascade delete all agent tokens, which
would then cascade delete all agent assignments, causing silent data
loss without any audit trail.

**Solution:**
Use RESTRICT instead of CASCADE - this prevents deletion if there are
dependent records, forcing explicit cleanup and preventing accidental
data loss.

**Impact:**
- Organizations cannot be deleted if they have agent tokens
- Agent tokens cannot be deleted if they have active assignments
- User must explicitly clean up dependencies first

This provides better data integrity and prevents accidental data loss.

Fixes Medium Bug #15 from reliability audit.
2026-03-05 09:25:55 -06:00
..
gettext Fix tests, credo issues, and Gaiia sync bugs 2026-02-15 11:55:49 -06:00
mibs mib update from librenms 2026-01-28 13:38:31 -06:00
profiles feat: Phase 1 Quick Wins - 11 vendor profiles implemented 2026-02-12 10:52:51 -06:00
proto proto: sync agent.proto with towerops-agent 2026-02-15 08:56:48 -06:00
repo fix: prevent silent data loss from cascade deletes on agent tokens 2026-03-05 09:25:55 -06:00
static docs: update changelog and memory with bug fix details 2026-03-05 08:55:59 -06:00