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:
@@ -259,6 +259,7 @@ class DataTransformer:
|
|||||||
"event_timestamp": event_timestamp,
|
"event_timestamp": event_timestamp,
|
||||||
"measurements": measurements,
|
"measurements": measurements,
|
||||||
"created_at": mysql_row.get("created_at"),
|
"created_at": mysql_row.get("created_at"),
|
||||||
|
"updated_at": mysql_row.get("updated_at"),
|
||||||
}
|
}
|
||||||
|
|
||||||
return pg_row
|
return pg_row
|
||||||
@@ -477,6 +478,7 @@ class DataTransformer:
|
|||||||
"event_timestamp",
|
"event_timestamp",
|
||||||
"measurements",
|
"measurements",
|
||||||
"created_at",
|
"created_at",
|
||||||
|
"updated_at",
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown table: {table}")
|
raise ValueError(f"Unknown table: {table}")
|
||||||
|
|||||||
@@ -89,7 +89,8 @@ CREATE TABLE IF NOT EXISTS elabdatadisp (
|
|||||||
tool_name_id VARCHAR(32) NOT NULL,
|
tool_name_id VARCHAR(32) NOT NULL,
|
||||||
event_timestamp TIMESTAMP NOT NULL,
|
event_timestamp TIMESTAMP NOT NULL,
|
||||||
measurements JSONB,
|
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));
|
) PARTITION BY RANGE (EXTRACT(YEAR FROM event_timestamp));
|
||||||
|
|
||||||
-- Note: PostgreSQL doesn't support PRIMARY KEY or UNIQUE constraints
|
-- Note: PostgreSQL doesn't support PRIMARY KEY or UNIQUE constraints
|
||||||
|
|||||||
Reference in New Issue
Block a user