From 62c9fc5c869e39726505bfae604c8825edf3f8cf Mon Sep 17 00:00:00 2001 From: dtoro Date: Wed, 29 Jul 2026 19:39:52 +0200 Subject: [PATCH] fix(scripts): cascade entity_status/signals/metrics in orphan cleanup --- scripts/cleanup-orphan-checks.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup-orphan-checks.sh b/scripts/cleanup-orphan-checks.sh index a397313..a99db5c 100755 --- a/scripts/cleanup-orphan-checks.sh +++ b/scripts/cleanup-orphan-checks.sh @@ -49,10 +49,17 @@ fi echo echo "== applying (config_mutation) ==" -# Delete check_defs first (FK), then the orphan check entities. +# check_defs first, then the dependent rows an entity owns (status, signals, +# metrics), then the orphan check entities. FKs prevent a plain entity delete. $PSQL_CMD -v ON_ERROR_STOP=1 <