Skip to content
Snippets Groups Projects
Commit c4422018 authored by Megan Henning's avatar Megan Henning
Browse files

Clear schema path from db

parent d561a868
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ from api import config
from api.dao import containerutil
from api.jobs.jobs import Job
CURRENT_DATABASE_VERSION = 12 # An int that is bumped when a new schema change is made
CURRENT_DATABASE_VERSION = 13 # An int that is bumped when a new schema change is made
def get_db_version():
......@@ -363,6 +363,16 @@ def upgrade_to_12():
u = {'$set': {'analyses.$.job': job._id, 'analyses.$.files': files}}
config.db.sessions.update_one(q, u)
def upgrade_to_13():
"""
scitran/core PR #403
Clear schema path from db config in order to set abs path to files
"""
config.db.singletons.find_one_and_update(
{'_id': 'config', 'persistent.schema_path': {'$exists': True}},
{'$unset': {'persistent.schema_path': ''}})
def upgrade_schema():
"""
......@@ -397,6 +407,8 @@ def upgrade_schema():
upgrade_to_11()
if db_version < 12:
upgrade_to_12()
if db_version < 13:
upgrade_to_13()
except Exception as e:
logging.exception('Incremental upgrade of db failed')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment