fixing tests and migration to the serialized deserialized JSONB
This commit is contained in:
@@ -201,6 +201,7 @@ async fn execute_table_definition(
|
||||
|
||||
// Indexes
|
||||
let mut stored_indexes = Vec::new();
|
||||
let mut indexes = Vec::new();
|
||||
for idx in request.indexes.drain(..) {
|
||||
let idx_name = idx.trim().to_string();
|
||||
validate_identifier_format(&idx_name, "Index name")?;
|
||||
@@ -211,17 +212,7 @@ async fn execute_table_definition(
|
||||
)));
|
||||
}
|
||||
|
||||
stored_indexes.push(idx_name);
|
||||
}
|
||||
|
||||
let mut indexes = Vec::new();
|
||||
for idx in request.indexes.drain(..) {
|
||||
let idx_name = idx.trim().to_string();
|
||||
validate_identifier_format(&idx_name, "Index name")?;
|
||||
|
||||
if !sql_columns.iter().any(|c| c.starts_with(&format!("\"{}\"", idx_name))) {
|
||||
return Err(Status::invalid_argument(format!("Index column '{}' not found", idx_name)));
|
||||
}
|
||||
stored_indexes.push(idx_name.clone());
|
||||
indexes.push(idx_name);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ async fn table_definition(#[future] schema: (PgPool, String, i64)) -> (PgPool, S
|
||||
|
||||
// Define columns and indexes for the table
|
||||
let columns = json!([
|
||||
"\"name\" TEXT",
|
||||
"\"age\" INTEGER",
|
||||
"\"email\" TEXT",
|
||||
"\"is_active\" BOOLEAN"
|
||||
{ "name": "name", "field_type": "text" },
|
||||
{ "name": "age", "field_type": "integer" },
|
||||
{ "name": "email", "field_type": "text" },
|
||||
{ "name": "is_active", "field_type": "boolean" }
|
||||
]);
|
||||
let indexes = json!([]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user