mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-31 13:54:27 +01:00
Return error when trying to drop an index associated with UNIQUE or PRIMARY KEY constraints
This commit is contained in:
@@ -343,6 +343,15 @@ pub fn translate_drop_index(
|
||||
)));
|
||||
}
|
||||
}
|
||||
// Return an error if the index is an unique or primary key.
|
||||
if let Some(idx) = maybe_index {
|
||||
if idx.unique {
|
||||
return Err(crate::error::LimboError::InvalidArgument(
|
||||
"index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped"
|
||||
.to_string(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// According to sqlite should emit Null instruction
|
||||
// but why?
|
||||
|
||||
Reference in New Issue
Block a user