mirror of
https://github.com/mbirth/tcl_update_db.git
synced 2024-11-10 07:16:46 +00:00
First draft of database structure.
This commit is contained in:
parent
3fddceaff5
commit
f2c2942d9c
45
sql/dbschema.sql
Normal file
45
sql/dbschema.sql
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
PRAGMA journal_mode=WAL;
|
||||||
|
PRAGMA foreign_keys=on;
|
||||||
|
|
||||||
|
CREATE TABLE "families" (
|
||||||
|
"familyId" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
"name" TEXT -- e.g. KEYone, Motion
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
-- Needs SQLite 3.7 or newer
|
||||||
|
INSERT INTO "families" ("name") VALUES
|
||||||
|
("KEYone"),
|
||||||
|
("Motion")
|
||||||
|
;
|
||||||
|
|
||||||
|
CREATE TABLE "models" (
|
||||||
|
"modelId" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
"familyId" INTEGER REFERENCES "families" ("familyId"),
|
||||||
|
"name" TEXT -- e.g. BBB100-1
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO "models" VALUES
|
||||||
|
(0, "BBB100-1"),
|
||||||
|
(0, "BBB100-2"),
|
||||||
|
(1, "BBD100-1")
|
||||||
|
;
|
||||||
|
|
||||||
|
CREATE TABLE "devices" (
|
||||||
|
"deviceId" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
"ref" TEXT, -- PRD number
|
||||||
|
"modelId" INTEGER REFERENCES "models" ("modelId"),
|
||||||
|
"name" TEXT -- e.g. Unlocked USA, Black KEYone
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO "devices" VALUES
|
||||||
|
("PRD-63117-011", 1, "Unlocked EMEA"),
|
||||||
|
("PRD-63116-001", 0, "Unlocked USA")
|
||||||
|
;
|
||||||
|
|
||||||
|
CREATE TABLE "otas" (
|
||||||
|
"otaId" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
"fv" TEXT, -- e.g. AAQ302
|
||||||
|
"sha1" TEXT -- SHA1 checksum of OTA file
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user