From e3816182551a6a27cec236795573cfdcaf41daf0 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 10 Dec 2025 20:28:19 +0100 Subject: [PATCH] fix: Support both uppercase and lowercase table names in TABLE_CONFIGS - TABLE_CONFIGS now accepts both 'RAWDATACOR' and 'rawdatacor' as keys - TABLE_CONFIGS now accepts both 'ELABDATADISP' and 'elabdatadisp' as keys - Reuse same config dict for both cases to avoid duplication This allows FullMigrator to work correctly when initialized with uppercase table names from the CLI while DataTransformer works with lowercase names. Fixes: 'Unknown table: RAWDATACOR' error during migration --- config.py | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/config.py b/config.py index 70d8d09..c7b3ed6 100644 --- a/config.py +++ b/config.py @@ -151,18 +151,23 @@ ELABDATADISP_FIELD_MAPPING = { # PostgreSQL Partition years (from both tables) PARTITION_YEARS = list(range(2014, 2032)) # 2014-2031 -# Table configurations -TABLE_CONFIGS = { - "rawdatacor": { - "mysql_table": "RAWDATACOR", - "postgres_table": "rawdatacor", - "primary_key": "id", - "partition_key": "event_date", - }, - "elabdatadisp": { - "mysql_table": "ELABDATADISP", - "postgres_table": "elabdatadisp", - "primary_key": "idElabData", - "partition_key": "event_date", - }, +# Table configurations - support both uppercase and lowercase keys +_rawdatacor_config = { + "mysql_table": "RAWDATACOR", + "postgres_table": "rawdatacor", + "primary_key": "id", + "partition_key": "event_date", +} +_elabdatadisp_config = { + "mysql_table": "ELABDATADISP", + "postgres_table": "elabdatadisp", + "primary_key": "idElabData", + "partition_key": "event_date", +} + +TABLE_CONFIGS = { + "rawdatacor": _rawdatacor_config, + "RAWDATACOR": _rawdatacor_config, + "elabdatadisp": _elabdatadisp_config, + "ELABDATADISP": _elabdatadisp_config, }