mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-21 01:40:49 +00:00
Fix database and collection deletion
This commit is contained in:
@@ -54,7 +54,6 @@ func (r *BadgerDataStore) DeleteCollection(databaseId string, collectionId strin
|
||||
generateKey(resourceid.ResourceTypeTrigger, databaseId, collectionId, "") + "/",
|
||||
generateKey(resourceid.ResourceTypeStoredProcedure, databaseId, collectionId, "") + "/",
|
||||
generateKey(resourceid.ResourceTypeUserDefinedFunction, databaseId, collectionId, "") + "/",
|
||||
collectionKey,
|
||||
}
|
||||
for _, prefix := range prefixes {
|
||||
if err := deleteKeysByPrefix(txn, prefix); err != nil {
|
||||
@@ -62,6 +61,8 @@ func (r *BadgerDataStore) DeleteCollection(databaseId string, collectionId strin
|
||||
}
|
||||
}
|
||||
|
||||
deleteKey(txn, collectionKey)
|
||||
|
||||
err := txn.Commit()
|
||||
if err != nil {
|
||||
logger.ErrorLn("Error while committing transaction:", err)
|
||||
|
||||
Reference in New Issue
Block a user