Update SQL query to exclude characters without associated user IDs: Modify the QUERY_GET_REGION_CHARACTERS to ensure only characters with a valid user_id are selected, enhancing data integrity and relevance in region-specific character retrieval.

This commit is contained in:
Torsten Schulz (local)
2026-01-14 10:28:13 +01:00
parent e1e4c08d38
commit f133f3999e

View File

@@ -709,7 +709,7 @@ UPDATE falukant_data."character" SET health = $1 WHERE id = $2;
"#;
pub const QUERY_GET_REGION_CHARACTERS: &str = r#"
SELECT id, health FROM falukant_data."character" WHERE region_id = $1 AND health > 0;
SELECT id, health FROM falukant_data."character" WHERE region_id = $1 AND health > 0 AND user_id IS NOT NULL;
"#;
pub const QUERY_DELETE_DIRECTOR: &str = r#"