server changes for the ID in the tree

This commit is contained in:
filipriec
2025-05-23 13:34:39 +02:00
parent ad37990da9
commit 5478a2ac27
4 changed files with 10 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ pub async fn get_profile_tree(
let tables = sqlx::query!(
r#"
SELECT
td.id as table_id,
td.table_name,
COALESCE(
json_agg(
@@ -40,7 +41,7 @@ pub async fn get_profile_tree(
LEFT JOIN table_definition_links tdl ON td.id = tdl.source_table_id
LEFT JOIN table_definitions ltd ON tdl.linked_table_id = ltd.id
WHERE td.profile_id = $1
GROUP BY td.table_name
GROUP BY td.id, td.table_name
"#,
profile.id
)
@@ -59,6 +60,7 @@ pub async fn get_profile_tree(
.unwrap_or_default();
Table {
id: record.table_id,
name: record.table_name,
depends_on: dependencies
.into_iter()