fix: Add updated_at column back to ELABDATADISP table

The updated_at column was removed from the schema but should be kept for
consistency with the original table structure and to track when rows are
modified.

Changes:
- Added updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP to table schema
- Added updated_at to get_column_order() for elabdatadisp
- Added updated_at to transform_elabdatadisp_row() output

This maintains backward compatibility while still consolidating node_num,
state, and calc_err into the measurements JSONB.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-25 18:46:03 +01:00
parent 42c0d9cdaf
commit 5045c8bd86
2 changed files with 4 additions and 1 deletions

View File

@@ -259,6 +259,7 @@ class DataTransformer:
"event_timestamp": event_timestamp,
"measurements": measurements,
"created_at": mysql_row.get("created_at"),
"updated_at": mysql_row.get("updated_at"),
}
return pg_row
@@ -477,6 +478,7 @@ class DataTransformer:
"event_timestamp",
"measurements",
"created_at",
"updated_at",
]
else:
raise ValueError(f"Unknown table: {table}")

View File

@@ -89,7 +89,8 @@ CREATE TABLE IF NOT EXISTS elabdatadisp (
tool_name_id VARCHAR(32) NOT NULL,
event_timestamp TIMESTAMP NOT NULL,
measurements JSONB,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) PARTITION BY RANGE (EXTRACT(YEAR FROM event_timestamp));
-- Note: PostgreSQL doesn't support PRIMARY KEY or UNIQUE constraints