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)
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,
}