-
Notifications
You must be signed in to change notification settings - Fork 3
Code to increment database version probably doesn't work #13
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
nedrexdb/nedrexdb/downloaders/__init__.py
Lines 75 to 81 in 115573c
| docs = list(MongoInstance.DB["metadata"].find()) | |
| if len(docs) == 1: | |
| version = docs[0]["version"] | |
| elif len(docs) == 0: | |
| version = "0.0.0" | |
| else: | |
| raise Exception("should only be one document in the metadata collection") |
On a rebuild, MongoInstance should be connected to the development instance (not the live instance), in which case there will be no metadata. To get (and increment) the version number, we'd need to connect to the live version to get the existing version, increment, and then store in the development DB.
A simple fix would be to write a function attempts to get the version number from the live DB using the pymongo interface (getting the relevant details for the live DB, if up, from the config).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working