gotelem/internal/db/migrations/1_initial_up.sql
saji c4bdf122a8 major cleanup/refactor
delete mprpc
move can frame to it's own library
create CANID type (better extended id support)
rework database format, only uses name + json now
busEvent and rawJsonEvent don't store the Id anymore
2024-02-12 09:45:23 -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" TEXT 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
);