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
This commit is contained in:
2025-12-10 20:28:19 +01:00
parent de6bde17c9
commit e381618255

View File

@@ -151,18 +151,23 @@ ELABDATADISP_FIELD_MAPPING = {
# PostgreSQL Partition years (from both tables) # PostgreSQL Partition years (from both tables)
PARTITION_YEARS = list(range(2014, 2032)) # 2014-2031 PARTITION_YEARS = list(range(2014, 2032)) # 2014-2031
# Table configurations # Table configurations - support both uppercase and lowercase keys
TABLE_CONFIGS = { _rawdatacor_config = {
"rawdatacor": { "mysql_table": "RAWDATACOR",
"mysql_table": "RAWDATACOR", "postgres_table": "rawdatacor",
"postgres_table": "rawdatacor", "primary_key": "id",
"primary_key": "id", "partition_key": "event_date",
"partition_key": "event_date", }
}, _elabdatadisp_config = {
"elabdatadisp": { "mysql_table": "ELABDATADISP",
"mysql_table": "ELABDATADISP", "postgres_table": "elabdatadisp",
"postgres_table": "elabdatadisp", "primary_key": "idElabData",
"primary_key": "idElabData", "partition_key": "event_date",
"partition_key": "event_date", }
},
TABLE_CONFIGS = {
"rawdatacor": _rawdatacor_config,
"RAWDATACOR": _rawdatacor_config,
"elabdatadisp": _elabdatadisp_config,
"ELABDATADISP": _elabdatadisp_config,
} }