diff --git a/ampel/ztf/t0/ArchiveUpdater.py b/ampel/ztf/t0/ArchiveUpdater.py index 07cca52..5db6744 100755 --- a/ampel/ztf/t0/ArchiveUpdater.py +++ b/ampel/ztf/t0/ArchiveUpdater.py @@ -50,7 +50,7 @@ def insert_alert_chunk( else: archive_id = conn.execute( AvroArchive.insert() - .values(uri=archive_uri) + .values(uri=archive_uri, count=len(alerts)) .returning(AvroArchive.c.avro_archive_id) ).fetchone()[0] @@ -165,6 +165,9 @@ def _insert_alert(self, conn, alert, partition_id=0, ingestion_time=0): ): if len(rows) > 0: self._update_history(conn, label, rows, alert_id) + + if forced_photometry := alert.get("fp_hists", []): + self._update_history(conn, "fp_hist", forced_photometry, alert_id) return True