SIENTIAPDE-1712

Add unique constraint on (model_id, timestamp, variable) in schema and implement idempotent export test to ensure no duplicates are created. Update CoreScouter and related tests to handle conflict resolution by ignoring duplicates.
This commit is contained in:
vitor-aignosi
2026-03-24 11:34:57 -03:00
parent 909ad25b63
commit d7cd9043b2
6 changed files with 1013 additions and 0 deletions

View File

@@ -89,6 +89,7 @@ def _create_schema_and_table(engine):
value numeric NULL,
"timestamp" timestamptz NOT NULL,
created_at timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL,
CONSTRAINT unique_timestamp_variable UNIQUE (model_id, "timestamp", variable),
PRIMARY KEY (id, created_at)
);
"""