From f00ed1216a7606c3b47b7b51e3ab0eb3947b5ff1 Mon Sep 17 00:00:00 2001 From: Harsha Kethineni Date: Wed, 20 Sep 2017 14:30:33 -0500 Subject: [PATCH] Reupdate collections including analyses --- bin/database.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/database.py b/bin/database.py index e01e6aad6..ca75c7a21 100755 --- a/bin/database.py +++ b/bin/database.py @@ -22,7 +22,7 @@ from api.types import Origin from api.jobs import batch -CURRENT_DATABASE_VERSION = 36 # An int that is bumped when a new schema change is made +CURRENT_DATABASE_VERSION = 37 # An int that is bumped when a new schema change is made def get_db_version(): @@ -1211,6 +1211,13 @@ def upgrade_to_36(): cursor = config.db.acquisitions.find({'files': { '$gt': [] }, 'files.mimetype': None}) process_cursor(cursor, upgrade_to_36_closure) +def upgrade_to_37(): + """ + scitran/core issue #916 - group-permission level site info needs to be removed from all levels + """ + for coll in ['acquisitions', 'groups', 'projects', 'sessions', 'analyses']: + cursor = config.db[coll].find({'permissions.site': {'$exists': True}}) + process_cursor(cursor, upgrade_to_32_closure, context = coll) ###