Skip to content

Commit

Permalink
restore ability to recreate test DB fixtures; recreate them
Browse files Browse the repository at this point in the history
  • Loading branch information
SandyRogers committed Jan 3, 2024
1 parent 28908ca commit 5852201
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/local-lite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ emg:
era:
ENGINE: 'django.db.backends.sqlite3'
NAME: '/opt/ci/testdbs/ena-testdb.sqlite'
ERA_TABLESPACE_PREFIX: ''

admin: True
downloads_bypass_nginx: True
Expand Down
9 changes: 6 additions & 3 deletions emgena/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
from __future__ import unicode_literals

from datetime import date
from django.db import models, NotSupportedError

from django.conf import settings
from django.db import models


class Status(models.IntegerChoices):
Expand Down Expand Up @@ -197,8 +199,9 @@ class Meta(StudyAbstract.Meta):
# ERA needs to be appended as the default connection tries to use
# the PUBLIC SYNONYM (according to ENA) and it's not working ATM
# we were advised to prefix the views and this is the simplest way.
# The short-term plan is to remove the dependency of ENA databases
db_table = 'ERA\".\"V_MGP_RUN_STUDY'
# The short-term plan is to remove the dependency of ENA databases
_prefix_workaround = settings.DATABASES['era'].get('ERA_TABLESPACE_PREFIX', 'ERA\".\"')
db_table = f'{_prefix_workaround}V_MGP_RUN_STUDY'


class AssemblyStudy(StudyAbstract):
Expand Down

0 comments on commit 5852201

Please sign in to comment.