From 9274430a09e3e95ca6af1cfdbd0e4d1c6c4c6ccf Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Sat, 3 Apr 2021 21:19:54 +0200
Subject: [PATCH] update data

---
 src/covid19/blueprints/ecdc/ecdc_model.py     | 24 +++++++++----------
 src/covid19/blueprints/owid/owid_model.py     |  6 ++---
 .../rki_vaccination/rki_vaccination_model.py  |  6 ++---
 src/covid19/blueprints/who/who_model.py       |  6 ++---
 4 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/src/covid19/blueprints/ecdc/ecdc_model.py b/src/covid19/blueprints/ecdc/ecdc_model.py
index 9f3500a2..a48c995e 100644
--- a/src/covid19/blueprints/ecdc/ecdc_model.py
+++ b/src/covid19/blueprints/ecdc/ecdc_model.py
@@ -5,10 +5,10 @@ from covid19.blueprints.application.application_model import ApplicationDateRepo
 
 
 class EcdcDateReported(ApplicationDateReported):
-    __tablename__ = 'ecdc_date_reported'
+    __tablename__ = 'ecdc_datereported'
     __mapper_args__ = {'concrete': True}
     __table_args__ = (
-        db.UniqueConstraint('date_reported', 'datum', name="uix_ecdc_date_reported"),
+        db.UniqueConstraint('date_reported', 'datum', name="uix_ecdc_datereported"),
     )
 
     id = db.Column(db.Integer, primary_key=True)
@@ -198,8 +198,8 @@ class EcdcData(db.Model):
         order_by='asc(EcdcCountry.countries_and_territories)'
     )
 
-    ecdc_date_reported_id = db.Column(db.Integer, db.ForeignKey('ecdc_date_reported.id'), nullable=False)
-    ecdc_date_reported = db.relationship(
+    ecdc_datereported_id = db.Column(db.Integer, db.ForeignKey('ecdc_datereported.id'), nullable=False)
+    ecdc_datereported = db.relationship(
         'EcdcDateReported',
         lazy='joined', cascade='all, delete',
         order_by='desc(EcdcDateReported.date_reported)'
@@ -229,30 +229,30 @@ class EcdcData(db.Model):
         return db.session.query(cls).filter(cls.id == other_id).one_or_none()
 
     @classmethod
-    def find_by_date_reported(cls, ecdc_date_reported, page: int):
+    def find_by_date_reported(cls, ecdc_datereported, page: int):
         return db.session.query(cls).filter(
-            cls.ecdc_date_reported_id == ecdc_date_reported.id)\
+            cls.ecdc_datereported_id == ecdc_datereported.id)\
             .order_by(cls.cumulative_number_for_14_days_of_covid19_cases_per_100000.desc())\
             .paginate(page, per_page=ITEMS_PER_PAGE)
 
     @classmethod
-    def find_by_date_reported_notification_rate(cls, ecdc_date_reported, page: int):
+    def find_by_date_reported_notification_rate(cls, ecdc_datereported, page: int):
         return db.session.query(cls).filter(
-            cls.ecdc_date_reported_id == ecdc_date_reported.id) \
+            cls.ecdc_datereported_id == ecdc_datereported.id) \
             .order_by(cls.cumulative_number_for_14_days_of_covid19_cases_per_100000.desc()) \
             .paginate(page, per_page=ITEMS_PER_PAGE)
 
     @classmethod
-    def find_by_date_reported_deaths_weekly(cls, ecdc_date_reported, page: int):
+    def find_by_date_reported_deaths_weekly(cls, ecdc_datereported, page: int):
         return db.session.query(cls).filter(
-            cls.ecdc_date_reported_id == ecdc_date_reported.id) \
+            cls.ecdc_datereported_id == ecdc_datereported.id) \
             .order_by(cls.deaths.desc()) \
             .paginate(page, per_page=ITEMS_PER_PAGE)
 
     @classmethod
-    def find_by_date_reported_cases_weekly(cls, ecdc_date_reported, page: int):
+    def find_by_date_reported_cases_weekly(cls, ecdc_datereported, page: int):
         return db.session.query(cls).filter(
-            cls.ecdc_date_reported_id == ecdc_date_reported.id) \
+            cls.ecdc_datereported_id == ecdc_datereported.id) \
             .order_by(cls.cases.desc()) \
             .paginate(page, per_page=ITEMS_PER_PAGE)
 
diff --git a/src/covid19/blueprints/owid/owid_model.py b/src/covid19/blueprints/owid/owid_model.py
index 2d13ee51..9031cfd7 100644
--- a/src/covid19/blueprints/owid/owid_model.py
+++ b/src/covid19/blueprints/owid/owid_model.py
@@ -6,10 +6,10 @@ from covid19.blueprints.application.application_model import ApplicationDateRepo
 
 
 class OwidDateReported(ApplicationDateReported):
-    __tablename__ = 'owid_date_reported'
+    __tablename__ = 'owid_datereported'
     __mapper_args__ = {'concrete': True}
     __table_args__ = (
-        db.UniqueConstraint('date_reported', 'datum', name="uix_owid_date_reported"),
+        db.UniqueConstraint('date_reported', 'datum', name="uix_owid_datereported"),
     )
 
     id = db.Column(db.Integer, primary_key=True)
@@ -129,7 +129,7 @@ class OwidData(db.Model):
 
     id = db.Column(db.Integer, primary_key=True)
     date_reported_id = db.Column(db.Integer,
-        db.ForeignKey('owid_date_reported.id'), nullable=False)
+        db.ForeignKey('owid_datereported.id'), nullable=False)
     date_reported = db.relationship(
         'OwidDateReported',
         lazy='joined',
diff --git a/src/covid19/blueprints/rki/rki_vaccination/rki_vaccination_model.py b/src/covid19/blueprints/rki/rki_vaccination/rki_vaccination_model.py
index 342ed124..64bf7b18 100644
--- a/src/covid19/blueprints/rki/rki_vaccination/rki_vaccination_model.py
+++ b/src/covid19/blueprints/rki/rki_vaccination/rki_vaccination_model.py
@@ -5,12 +5,12 @@ from covid19.blueprints.application.application_model import ApplicationDateRepo
 
 
 class RkiVaccinationDateReported(ApplicationDateReported):
-    __tablename__ = 'rki_vaccination_date_reported'
+    __tablename__ = 'rki_vaccination_datereported'
     __mapper_args__ = {
         'concrete': True
     }
     __table_args__ = (
-        db.UniqueConstraint('date_reported', 'datum', name="uix_rki_vaccination_date_reported"),
+        db.UniqueConstraint('date_reported', 'datum', name="uix_rki_vaccination_datereported"),
     )
 
     id = db.Column(db.Integer, primary_key=True)
@@ -49,7 +49,7 @@ class RkiVaccinationData(db.Model):
     __tablename__ = 'rki_vaccination'
 
     id = db.Column(db.Integer, primary_key=True)
-    date_reported_id = db.Column(db.Integer, db.ForeignKey('rki_vaccination_date_reported.id'), nullable=False)
+    date_reported_id = db.Column(db.Integer, db.ForeignKey('rki_vaccination_datereported.id'), nullable=False)
     date_reported = db.relationship(
         'RkiVaccinationDateReported',
         lazy='joined',
diff --git a/src/covid19/blueprints/who/who_model.py b/src/covid19/blueprints/who/who_model.py
index 78e5931a..85099568 100644
--- a/src/covid19/blueprints/who/who_model.py
+++ b/src/covid19/blueprints/who/who_model.py
@@ -6,10 +6,10 @@ from covid19.blueprints.application.application_model import ApplicationDateRepo
 
 
 class WhoDateReported(ApplicationDateReported):
-    __tablename__ = 'who_date_reported'
+    __tablename__ = 'who_datereported'
     __mapper_args__ = {'concrete': True}
     __table_args__ = (
-        db.UniqueConstraint('date_reported', 'datum', name="uix_who_date_reported"),
+        db.UniqueConstraint('date_reported', 'datum', name="uix_who_datereported"),
     )
 
     id = db.Column(db.Integer, primary_key=True)
@@ -159,7 +159,7 @@ class WhoData(db.Model):
     deaths_new = db.Column(db.Integer, nullable=False)
     deaths_cumulative = db.Column(db.Integer, nullable=False)
     date_reported_id = db.Column(db.Integer,
-        db.ForeignKey('who_date_reported.id'), nullable=False)
+        db.ForeignKey('who_datereported.id'), nullable=False)
     date_reported = db.relationship(
         'WhoDateReported',
         lazy='joined',
-- 
GitLab