gotelem/migrations/1_initial_up.sql
saji 4e6f8db7ed
All checks were successful
Go / build (1.21) (push) Successful in 1m16s
Go / build (1.22) (push) Successful in 1m15s
combine separate packages
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
);