tests are passing better than ever before, its looking decent actually nowc

This commit is contained in:
filipriec
2025-06-21 16:18:32 +02:00
parent 714a5f2f1c
commit 298f56a53c
4 changed files with 42 additions and 16 deletions

View File

@@ -312,7 +312,8 @@ async fn generate_table_sql(
indexes: &[String],
links: &[(i64, bool)],
) -> Result<(String, Vec<String>), Status> {
let qualified_table = format!("{}.\"{}\"", profile_name, table_name);
// CHANGE: Quote the schema name
let qualified_table = format!("\"{}\".\"{}\"", profile_name, table_name);
let mut system_columns = vec![
"id BIGSERIAL PRIMARY KEY".to_string(),
@@ -321,7 +322,8 @@ async fn generate_table_sql(
for (linked_id, required) in links {
let linked_table = get_table_name_by_id(tx, *linked_id).await?;
let qualified_linked_table = format!("{}.\"{}\"", profile_name, linked_table);
// CHANGE: Quote the schema name here too
let qualified_linked_table = format!("\"{}\".\"{}\"", profile_name, linked_table);
let base_name = linked_table.split_once('_')
.map(|(_, rest)| rest)
.unwrap_or(&linked_table)