Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion bin/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():

Expand Down Expand Up @@ -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)


###
Expand Down