get tests are now passing without any issue

This commit is contained in:
filipriec
2025-03-05 09:06:21 +01:00
parent 967915d734
commit c976d551fa

View File

@@ -42,19 +42,21 @@ async fn table_definition(#[future] profile: (PgPool, String, i64)) -> (PgPool,
let (pool, profile_name, profile_id) = profile.await; let (pool, profile_name, profile_id) = profile.await;
let table_name = format!("test_table_{}", Utc::now().timestamp_nanos_opt().unwrap_or_default()); let table_name = format!("test_table_{}", Utc::now().timestamp_nanos_opt().unwrap_or_default());
// Define columns for the table // Define columns and indexes for the table
let columns = json!([ let columns = json!([
"\"name\" VARCHAR(255)", "\"name\" VARCHAR(255)",
"\"age\" INTEGER", "\"age\" INTEGER",
"\"email\" VARCHAR(100)", "\"email\" VARCHAR(100)",
"\"is_active\" BOOLEAN" "\"is_active\" BOOLEAN"
]); ]);
let indexes = json!([]); // Add empty indexes array
let table_def = sqlx::query!( let table_def = sqlx::query!(
"INSERT INTO table_definitions (profile_id, table_name, columns) VALUES ($1, $2, $3) RETURNING id", "INSERT INTO table_definitions (profile_id, table_name, columns, indexes) VALUES ($1, $2, $3, $4) RETURNING id",
profile_id, profile_id,
table_name, table_name,
columns columns,
indexes // Add indexes to the insert
) )
.fetch_one(&pool) .fetch_one(&pool)
.await .await