Skip to content

Code to increment database version probably doesn't work #13

@james-skelton

Description

@james-skelton

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions