more fixes
This commit is contained in:
@@ -203,8 +203,17 @@ async fn execute_table_definition(
|
||||
.map_err(|e| Status::internal(format!("Schema creation failed: {}", e)))?;
|
||||
|
||||
let mut links = Vec::new();
|
||||
let mut seen_tables = std::collections::HashSet::new();
|
||||
|
||||
for link in request.links.drain(..) {
|
||||
// CHANGED: Use schema_id instead of profile_id
|
||||
// Check for duplicate link
|
||||
if !seen_tables.insert(link.linked_table_name.clone()) {
|
||||
return Err(Status::invalid_argument(format!(
|
||||
"Duplicate link to table '{}'",
|
||||
link.linked_table_name
|
||||
)));
|
||||
}
|
||||
|
||||
let linked_table = sqlx::query!(
|
||||
"SELECT id FROM table_definitions
|
||||
WHERE schema_id = $1 AND table_name = $2",
|
||||
|
||||
Reference in New Issue
Block a user