Skip to content

Commit

Permalink
add view for telemetry panels to have latest ids
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7d8 committed Dec 28, 2024
1 parent be59253 commit 0234168
Show file tree
Hide file tree
Showing 4 changed files with 526 additions and 2 deletions.
1 change: 1 addition & 0 deletions migrations/0002_stale_maelstrom.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE VIEW "public"."telemetry_panels_with_latest" AS (select "telemetry_panels"."id", "telemetry_panels"."created", "telemetry_panels"."last_update", "latest"."panel_id", "latest_telemetry_data_id" from "telemetry_panels" left join (select "panel_id", max("id") as "latest_telemetry_data_id" from "telemetry_data" group by "telemetry_data"."panel_id") "latest" on "telemetry_panels"."id" = latest.panel_id);
Loading

0 comments on commit 0234168

Please sign in to comment.