Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
c4422018
Commit
c4422018
authored
8 years ago
by
Megan Henning
Browse files
Options
Downloads
Patches
Plain Diff
Clear schema path from db
parent
d561a868
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/database.py
+13
-1
13 additions, 1 deletion
bin/database.py
with
13 additions
and
1 deletion
bin/database.py
+
13
−
1
View file @
c4422018
...
...
@@ -11,7 +11,7 @@ from api import config
from
api.dao
import
containerutil
from
api.jobs.jobs
import
Job
CURRENT_DATABASE_VERSION
=
1
2
# An int that is bumped when a new schema change is made
CURRENT_DATABASE_VERSION
=
1
3
# 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
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment