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:
17
config.py
17
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": {
|
||||
# Table configurations - support both uppercase and lowercase keys
|
||||
_rawdatacor_config = {
|
||||
"mysql_table": "RAWDATACOR",
|
||||
"postgres_table": "rawdatacor",
|
||||
"primary_key": "id",
|
||||
"partition_key": "event_date",
|
||||
},
|
||||
"elabdatadisp": {
|
||||
}
|
||||
_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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user