5 more tests to go

This commit is contained in:
filipriec
2025-06-21 21:01:49 +02:00
parent 298f56a53c
commit 06d98aab5c
5 changed files with 22 additions and 16 deletions

View File

@@ -229,7 +229,7 @@ async fn execute_table_definition(
return Err(Status::invalid_argument("Invalid column name"));
}
if col_name.ends_with("_id") || col_name == "id" || col_name == "deleted" || col_name == "created_at" {
return Err(Status::invalid_argument("Invalid column name"));
return Err(Status::invalid_argument("Column name cannot be 'id', 'deleted', 'created_at' or end with '_id'"));
}
let sql_type = map_field_type(&col_def.field_type)?;
columns.push(format!("\"{}\" {}", col_name, sql_type));