Persist telemetry data in local sqlite database

This commit is contained in:
Claudio Ortolina
2026-03-05 13:37:18 +00:00
parent bb541c8004
commit f109057be5
12 changed files with 128 additions and 19 deletions
@@ -0,0 +1,15 @@
defmodule MusicLibrary.TelemetryRepo.Migrations.CreateTelemetryDatapoints do
use Ecto.Migration
def change do
create table(:telemetry_datapoints) do
add :metric_key, :text, null: false
add :label, :text
add :measurement, :real, null: false
add :time, :integer, null: false
end
# Serves read queries (ORDER BY time) and prune subselect (ORDER BY id DESC)
create index(:telemetry_datapoints, [:metric_key, :time])
end
end