From c65fdbe75e6b975b6a659ce2979d57c7ed2e9529 Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Fri, 5 Feb 2021 16:30:58 +0100
Subject: [PATCH] work

---
 covid19/blueprints/europe/europe_model.py  | 2 +-
 covid19/blueprints/rki/rki_model.py        | 5 -----
 covid19/blueprints/who/who_model.py        | 2 +-
 covid19/blueprints/who/who_model_import.py | 2 +-
 4 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/covid19/blueprints/europe/europe_model.py b/covid19/blueprints/europe/europe_model.py
index af568535..c96a1253 100644
--- a/covid19/blueprints/europe/europe_model.py
+++ b/covid19/blueprints/europe/europe_model.py
@@ -20,7 +20,7 @@ class EuropeCountry(db.Model):
     geo_id = db.Column(db.String(255), nullable=False)
     country_territory_code = db.Column(db.String(255), nullable=False)
 
-    continent_id = db.Column(db.Integer, db.ForeignKey('europe_continent.id'), nullable=False)
+    continent_id = db.Column(db.Integer, db.ForeignKey('common_region.id'), nullable=False)
     continent = db.relationship('EuropeContinent', lazy='subquery', order_by='EuropeContinent.continent_exp')
 
     @classmethod
diff --git a/covid19/blueprints/rki/rki_model.py b/covid19/blueprints/rki/rki_model.py
index 46208f87..849382d3 100644
--- a/covid19/blueprints/rki/rki_model.py
+++ b/covid19/blueprints/rki/rki_model.py
@@ -13,11 +13,6 @@ class RkiDateReported(CommonDateReported):
 class RkiRegion(CommonRegion):
     __mapper_args__ = {'polymorphic_identity': 'rki'}
 
-    __tablename__ = 'rki_region'
-
-    id = db.Column(db.Integer, primary_key=True)
-    region = db.Column(db.String(255), unique=True)
-
 
 class RkiCountry(db.Model):
     __tablename__ = 'rki_country'
diff --git a/covid19/blueprints/who/who_model.py b/covid19/blueprints/who/who_model.py
index d536b4a7..3be1bdb7 100644
--- a/covid19/blueprints/who/who_model.py
+++ b/covid19/blueprints/who/who_model.py
@@ -18,7 +18,7 @@ class WhoCountry(db.Model):
     id = db.Column(db.Integer, primary_key=True)
     country_code = db.Column(db.String(255), unique=True, nullable=False)
     country = db.Column(db.String(255), unique=True, nullable=False)
-    region_id = db.Column(db.Integer, db.ForeignKey('who_region.id'), nullable=False)
+    region_id = db.Column(db.Integer, db.ForeignKey('common_region.id'), nullable=False)
     region = db.relationship(
         'WhoRegion',
         lazy='joined',
diff --git a/covid19/blueprints/who/who_model_import.py b/covid19/blueprints/who/who_model_import.py
index 1c08dee4..dd6390e6 100644
--- a/covid19/blueprints/who/who_model_import.py
+++ b/covid19/blueprints/who/who_model_import.py
@@ -66,7 +66,7 @@ class WhoGlobalDataImportTable(db.Model):
                 from
                     who_global_data
                 left join
-                    who_date_reported
+                    common_date_reported
                 on
                     who_global_data.date_reported_id=common_date_reported.id
             )
-- 
GitLab