@ -584,6 +584,9 @@ impl<'a> SessionTx<'a> {
bail!("Cannot destroy temp relation");
}
let store = self.get_relation(name, true)?;
if !stored.indices.is_empty() {
bail!("Cannot remove stored relation `{}` with indices attached.", name);
if store.access_level < AccessLevel::Normal {
bail!(InsufficientAccessLevel(
store.name.to_string(),