server changes for the ID in the tree
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user