Unable to delete empty, unused collection
In my schema file I had specified a collection and later I changes the collection name, it works., In my Convex dashboard I can see both the collections (empty for now)
I tried to delete the collection I am not using, but it threw error
"Failed to insert or update a document in table "COLLECTION_NAME" because it does not match the schema: Table "COLLECTION_NAME" that appears in schema must exist"
Ok, I added the collection back in schema file and then tried to delete it, In this case I got error saying (not exact): Collection exists in schema file, I cannot delete it, First I need to remvoe the collection from schema file.
Now, you see the condition issue I am running into?
TLDR; To delete a collection I have to remove it from my schema file AND to delete a collection, that collection must be present in the schema file.
3 Replies
The wording of the error is confusing, but both errors are saying the same thing: to delete the table (ie "collection") in the dashboard it needs to be gone from your schema file.
If it's still not working, can you share your schema file and deployment url? Thanks
I found the issue, Although I had removed the table from schema, I was still referencing to it in another table, removed the reference and I was able to delete the collection from Convex Dashboard.
Yep it needs to be fully removed from the schema. I'll update the error message because the current wording is terrible (my bad)