Private
Public Access
1
0

fix(api): include deleted monitors in name-based lookups

Remove status filter from GetMonitorByNameAndIPVersion query to allow
historical score data for deleted monitors to be accessible when
querying by monitor name/TLS name, making behavior consistent with
ID-based queries.
This commit is contained in:
2025-08-03 14:53:21 -07:00
parent 9c6b8d1867
commit 3e6a0f9e63
2 changed files with 2 additions and 4 deletions

View File

@@ -17,8 +17,7 @@ select id, id_token, type, user_id, account_id, hostname, location, ip, ip_versi
where
tls_name like ? AND
(ip_version = ? OR (type = 'score' AND ip_version IS NULL)) AND
is_current = 1 AND
status != 'deleted'
is_current = 1
order by id
limit 1
`

View File

@@ -52,8 +52,7 @@ select * from monitors
where
tls_name like sqlc.arg('tls_name') AND
(ip_version = sqlc.arg('ip_version') OR (type = 'score' AND ip_version IS NULL)) AND
is_current = 1 AND
status != 'deleted'
is_current = 1
order by id
limit 1;