1
0
mirror of https://github.com/mbirth/tcl_update_db.git synced 2024-11-09 23:06:45 +00:00

Added possibly useful views.

This commit is contained in:
Markus Birth 2017-12-19 22:42:06 +01:00
parent 58c277661f
commit c759256adc
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -19,6 +19,11 @@ CREATE TABLE "devices" (
"name" TEXT -- e.g. Unlocked USA, Black KEYone
);
CREATE VIEW "full_device_names" AS
SELECT * FROM "families" f
LEFT JOIN "models" m ON m.familyId=f.familyId
LEFT JOIN "devices" d ON d.modelId=m.modelId;
-- we only care about the first file for now
CREATE TABLE "files" (
"sha1" TEXT UNIQUE PRIMARY KEY, -- checksum of file
@ -50,3 +55,7 @@ CREATE UNIQUE INDEX "index_updates" ON "updates" (
"fwId",
"file_id"
);
CREATE VIEW "updates_files" AS
SELECT * FROM "updates" u
LEFT JOIN "files" f ON u.file_sha1=f.sha1;