diff --git a/covid19/blueprints/europe/europe_model.py b/covid19/blueprints/europe/europe_model.py index af568535f3b3602eeb73445849bb63aae0daa449..c96a1253061ef9e588c95ec96dc67cda15be79e5 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 46208f87a325aebbe08afd94911b84f55d415302..849382d38a0283ce04c024c79d7c0536a99367de 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 d536b4a779a6383948cfea3df142c1a5f0021be5..3be1bdb7f5b794f785b007856d800ef940b29e35 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 1c08dee4c974a41671c29b1495ccfa9f9ff69269..dd6390e6e6e37d290bfb1cdaef71488cad9a73a4 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 )