Add child relation deletion by parent query: Introduced a new SQL query to delete child relations where the character is either a father or mother. Updated relevant workers to execute this query before deleting child relations, ensuring proper cleanup of relationships during character deletion.
This commit is contained in:
@@ -20,6 +20,7 @@ use crate::worker::sql::{
|
||||
QUERY_DELETE_DIRECTOR,
|
||||
QUERY_DELETE_RELATIONSHIP,
|
||||
QUERY_DELETE_CHILD_RELATION,
|
||||
QUERY_DELETE_CHILD_RELATION_BY_PARENT,
|
||||
QUERY_INSERT_NOTIFICATION,
|
||||
QUERY_MARK_CHARACTER_DECEASED,
|
||||
};
|
||||
@@ -426,7 +427,9 @@ impl CharacterCreationWorker {
|
||||
}
|
||||
}
|
||||
|
||||
// 3) Child-Relations löschen und Eltern benachrichtigen
|
||||
// 3) Child-Relations löschen (als Elter zuerst, dann als Kind) und Eltern benachrichtigen
|
||||
conn.prepare("delete_child_relation_by_parent", QUERY_DELETE_CHILD_RELATION_BY_PARENT)?;
|
||||
conn.execute("delete_child_relation_by_parent", &[&character_id])?;
|
||||
conn.prepare("delete_child_relation", QUERY_DELETE_CHILD_RELATION)?;
|
||||
let child_result = conn.execute("delete_child_relation", &[&character_id])?;
|
||||
for row in child_result {
|
||||
|
||||
Reference in New Issue
Block a user