diff --git a/internal/report/snapshots.go b/internal/report/snapshots.go index d3808d8..fbf4745 100644 --- a/internal/report/snapshots.go +++ b/internal/report/snapshots.go @@ -1246,7 +1246,7 @@ missing_deleted AS ( prev_agg."VcpuCount", prev_agg."RamGB", prev_agg.pool, - prev_agg.creation_time AS creation_time, + COALESCE(prev_agg.creation_time, lifecycle.first_seen) AS creation_time, COALESCE(lifecycle.deleted_at, prev_agg.deletion_time) AS deletion_time, %s AS presence FROM prev_agg @@ -1262,7 +1262,7 @@ agg_presence AS ( agg."VcpuCount", agg."RamGB", agg.pool, - agg.creation_time AS creation_time, + COALESCE(agg.creation_time, lifecycle.first_seen) AS creation_time, COALESCE(lifecycle.deleted_at, agg.deletion_time) AS deletion_time, %s AS presence FROM agg