diff --git a/src/flask_covid19/blueprints/data_divi/divi_model.py b/src/flask_covid19/blueprints/data_divi/divi_model.py index 91d62b3c8aa28f72b3d0c20e00c28e7eaf120280..01a5c50073a1183d5914c6b724a3176f18442798 100644 --- a/src/flask_covid19/blueprints/data_divi/divi_model.py +++ b/src/flask_covid19/blueprints/data_divi/divi_model.py @@ -13,14 +13,16 @@ class DiviDateReported(BlueprintDateReported): ) id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) day_of_month = db.Column(db.Integer, nullable=False) day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) + day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) + year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) @classmethod def create_new_object_factory(cls, my_date_rep): diff --git a/src/flask_covid19/blueprints/data_ecdc/ecdc_model.py b/src/flask_covid19/blueprints/data_ecdc/ecdc_model.py index 5cab360b52b557a046c234b2d92fb0867725e7c0..7202a44b1367a1734d0d37b4f63e36f054ba8f07 100644 --- a/src/flask_covid19/blueprints/data_ecdc/ecdc_model.py +++ b/src/flask_covid19/blueprints/data_ecdc/ecdc_model.py @@ -11,14 +11,16 @@ class EcdcDateReported(BlueprintDateReported): ) id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) day_of_month = db.Column(db.Integer, nullable=False) day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) + day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) + year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) def get_name_for_datum(self): return self.date_reported_import_str diff --git a/src/flask_covid19/blueprints/data_ecdc/ecdc_model_import.py b/src/flask_covid19/blueprints/data_ecdc/ecdc_model_import.py index a4db66af5fa30953b1f5ff106fe6f88e086a0333..dd7b231d0c02f6f5fc7d7db0aa6a5ec3d806a3be 100644 --- a/src/flask_covid19/blueprints/data_ecdc/ecdc_model_import.py +++ b/src/flask_covid19/blueprints/data_ecdc/ecdc_model_import.py @@ -124,8 +124,6 @@ class EcdcFlat(db.Model): __tablename__ = 'application__import__ecdc_flat' id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) @@ -133,7 +131,9 @@ class EcdcFlat(db.Model): day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) location = db.Column(db.String(255), nullable=False) location_group = db.Column(db.String(255), nullable=False) date_rep = db.Column(db.String(255), nullable=False) diff --git a/src/flask_covid19/blueprints/data_owid/owid_model.py b/src/flask_covid19/blueprints/data_owid/owid_model.py index 23add262390ee810f3d13edb6dbc872e8c3fc189..d48a870704674ab620f059340cadda48226221d6 100644 --- a/src/flask_covid19/blueprints/data_owid/owid_model.py +++ b/src/flask_covid19/blueprints/data_owid/owid_model.py @@ -29,15 +29,16 @@ class OwidDateReported(BlueprintDateReported): id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) day_of_month = db.Column(db.Integer, nullable=False) day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) - processed = db.Column(db.BOOLEAN, nullable=False) + day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) + year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) def get_sql_notion(self): result = str(self.year) diff --git a/src/flask_covid19/blueprints/data_owid/owid_model_import.py b/src/flask_covid19/blueprints/data_owid/owid_model_import.py index 28304e75a2c160f966b222b94ca983181906df0e..25aedb3a1990e36064428c14c60f47746dbe5ffa 100644 --- a/src/flask_covid19/blueprints/data_owid/owid_model_import.py +++ b/src/flask_covid19/blueprints/data_owid/owid_model_import.py @@ -284,8 +284,6 @@ class OwidFlat(db.Model): __tablename__ = 'application__import__owid_flat' id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) @@ -293,7 +291,9 @@ class OwidFlat(db.Model): day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) location = db.Column(db.String(255), nullable=False) location_group = db.Column(db.String(255), nullable=False) iso_code = db.Column(db.String(255), nullable=False) diff --git a/src/flask_covid19/blueprints/data_rki_cases/rki_model.py b/src/flask_covid19/blueprints/data_rki_cases/rki_model.py index 192e6b7f172e80e4d9d5f09daf0005e0ec6f167a..0d843668be077920e2210119a150ac4f47c567c2 100644 --- a/src/flask_covid19/blueprints/data_rki_cases/rki_model.py +++ b/src/flask_covid19/blueprints/data_rki_cases/rki_model.py @@ -13,14 +13,16 @@ class RkiMeldedatum(BlueprintDateReported): ) id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) day_of_month = db.Column(db.Integer, nullable=False) day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) + day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) + year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) @classmethod def create_new_object_factory(cls, my_date_rep): diff --git a/src/flask_covid19/blueprints/data_rki_cases/rki_model_import.py b/src/flask_covid19/blueprints/data_rki_cases/rki_model_import.py index 98b8508b67e660ba4235154971d8b629855bc745..6d91502027705c7b89c65dbe50dbffae10856ab8 100644 --- a/src/flask_covid19/blueprints/data_rki_cases/rki_model_import.py +++ b/src/flask_covid19/blueprints/data_rki_cases/rki_model_import.py @@ -60,8 +60,6 @@ class RkiFlat(db.Model): __tablename__ = 'application__import__rki_cases_flat' id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) @@ -69,7 +67,9 @@ class RkiFlat(db.Model): day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) location = db.Column(db.String(255), nullable=False) location_group = db.Column(db.String(255), nullable=False) fid = db.Column(db.String(255), nullable=False) diff --git a/src/flask_covid19/blueprints/data_rki_vaccination/rki_vaccination_model.py b/src/flask_covid19/blueprints/data_rki_vaccination/rki_vaccination_model.py index fed400008a33ae31f8fccc721bf48093f69b5a12..4f4da79f6ef89495c52e0cf0c84372cbdf9074c9 100644 --- a/src/flask_covid19/blueprints/data_rki_vaccination/rki_vaccination_model.py +++ b/src/flask_covid19/blueprints/data_rki_vaccination/rki_vaccination_model.py @@ -14,14 +14,16 @@ class RkiVaccinationDateReported(BlueprintDateReported): ) id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) day_of_month = db.Column(db.Integer, nullable=False) day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) + day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) + year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) @classmethod def create_new_object_factory(cls, my_date_rep: str): diff --git a/src/flask_covid19/blueprints/data_rki_vaccination/rki_vaccination_model_import.py b/src/flask_covid19/blueprints/data_rki_vaccination/rki_vaccination_model_import.py index 99bc5f1e47c3dc11a37c894a43d2f7de5e3c7058..f58d9ddca3b5e6bff2060056e5d18dcb769a2ac6 100644 --- a/src/flask_covid19/blueprints/data_rki_vaccination/rki_vaccination_model_import.py +++ b/src/flask_covid19/blueprints/data_rki_vaccination/rki_vaccination_model_import.py @@ -125,8 +125,6 @@ class RkiVaccinationFlat(db.Model): __tablename__ = 'application__import__rki_vaccination_flat' id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) @@ -134,7 +132,9 @@ class RkiVaccinationFlat(db.Model): day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) location = db.Column(db.String(255), nullable=False) location_group = db.Column(db.String(255), nullable=False) dosen_kumulativ = db.Column(db.Integer, nullable=False) diff --git a/src/flask_covid19/blueprints/data_who/who_model.py b/src/flask_covid19/blueprints/data_who/who_model.py index e22b4fc81e081611e8a9e04170eb779576285c1f..e814d3e4017658b01db673960345abc4b4fde473 100644 --- a/src/flask_covid19/blueprints/data_who/who_model.py +++ b/src/flask_covid19/blueprints/data_who/who_model.py @@ -13,14 +13,16 @@ class WhoDateReported(BlueprintDateReported): ) id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) day_of_month = db.Column(db.Integer, nullable=False) day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) + day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) + year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) @classmethod def create_new_object_factory(cls, my_date_rep): diff --git a/src/flask_covid19/blueprints/data_who/who_model_import.py b/src/flask_covid19/blueprints/data_who/who_model_import.py index a8217130dec17244a8abb22cdc9dbab0b935149c..50cea993a8260928631100eabe8db9f80eeea64c 100644 --- a/src/flask_covid19/blueprints/data_who/who_model_import.py +++ b/src/flask_covid19/blueprints/data_who/who_model_import.py @@ -177,8 +177,6 @@ class WhoFlat(db.Model): __tablename__ = 'application__import__who_flat' id = db.Column(db.Integer, primary_key=True) - date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) - year_week = db.Column(db.String(255), nullable=False) datum = db.Column(db.Date, nullable=False, unique=True) year = db.Column(db.Integer, nullable=False) month = db.Column(db.Integer, nullable=False) @@ -186,7 +184,9 @@ class WhoFlat(db.Model): day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) day_of_year = db.Column(db.Integer, nullable=True) + year_week = db.Column(db.String(255), nullable=False) year_day_of_year = db.Column(db.String(255), nullable=True, unique=True) + date_reported_import_str = db.Column(db.String(255), nullable=False, unique=True) location = db.Column(db.String(255), nullable=False) location_group = db.Column(db.String(255), nullable=False) new_cases = db.Column(db.String(255), nullable=False)