get tests are now passing without any issue
This commit is contained in:
@@ -42,19 +42,21 @@ async fn table_definition(#[future] profile: (PgPool, String, i64)) -> (PgPool,
|
||||
let (pool, profile_name, profile_id) = profile.await;
|
||||
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!([
|
||||
"\"name\" VARCHAR(255)",
|
||||
"\"age\" INTEGER",
|
||||
"\"email\" VARCHAR(100)",
|
||||
"\"is_active\" BOOLEAN"
|
||||
]);
|
||||
let indexes = json!([]); // Add empty indexes array
|
||||
|
||||
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,
|
||||
table_name,
|
||||
columns
|
||||
columns,
|
||||
indexes // Add indexes to the insert
|
||||
)
|
||||
.fetch_one(&pool)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user