From aa052b6636fedc261c785780de8cc56a89cde33c Mon Sep 17 00:00:00 2001 From: Martin Beracochea Date: Tue, 31 Oct 2023 16:00:45 +0000 Subject: [PATCH] Workaround to query ENA / ERAPRO Views. 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 --- emgena/models.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/emgena/models.py b/emgena/models.py index 3e34271a7..c3aaba848 100644 --- a/emgena/models.py +++ b/emgena/models.py @@ -194,12 +194,20 @@ class Meta: class RunStudy(StudyAbstract): class Meta(StudyAbstract.Meta): - db_table = 'V_MGP_RUN_STUDY' + # 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' class AssemblyStudy(StudyAbstract): class Meta(StudyAbstract.Meta): - db_table = 'V_MGP_ASSEMBLY_STUDY' + # 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_ASSEMBLY_STUDY' class Project(models.Model):