mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-08 18:54:21 +01:00
Merge 'core/translate: Add support' from Pekka Enberg
Fixes #2263 Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #2774
This commit is contained in:
@@ -44,6 +44,10 @@ pub fn translate_create_index(
|
||||
// Check if the index is being created on a valid btree table and
|
||||
// the name is globally unique in the schema.
|
||||
if !schema.is_unique_idx_name(&idx_name) {
|
||||
// If IF NOT EXISTS is specified, silently return without error
|
||||
if unique_if_not_exists.1 {
|
||||
return Ok(program);
|
||||
}
|
||||
crate::bail_parse_error!("Error: index with name '{idx_name}' already exists.");
|
||||
}
|
||||
let Some(tbl) = schema.tables.get(&tbl_name) else {
|
||||
|
||||
Reference in New Issue
Block a user