gotelem/migrations/1_initial_up.sql
2024-03-02 21:49:18 -06:00

15 lines
365 B
SQL

CREATE TABLE "bus_events" (
"ts" INTEGER NOT NULL, -- timestamp, unix milliseconds
"name" TEXT NOT NULL, -- name of base packet
"data" JSON NOT NULL CHECK(json_valid(data)) -- JSON object describing the data, including index if any
);
CREATE INDEX "ids_timestamped" ON "bus_events" (
"name",
"ts" DESC
);
CREATE INDEX "times" ON "bus_events" (
"ts" DESC
);