mirror of
https://github.com/clearml/clearml-server
synced 2025-01-31 10:56:48 +00:00
Add migration to verify correct project ordering
This commit is contained in:
parent
6718862dbe
commit
111d80e88d
11
server/mongo/migrations/0.16.1.py
Normal file
11
server/mongo/migrations/0.16.1.py
Normal file
@ -0,0 +1,11 @@
|
||||
from pymongo.database import Database, Collection
|
||||
|
||||
|
||||
def migrate_backend(db: Database):
|
||||
collection: Collection = db["project"]
|
||||
featured = "featured"
|
||||
query = {featured: {"$exists": False}}
|
||||
for doc in collection.find(filter=query, projection=()):
|
||||
collection.update_one(
|
||||
{"_id": doc["_id"]}, {"$set": {featured: 9999}},
|
||||
)
|
Loading…
Reference in New Issue
Block a user