mirror of
https://github.com/mbirth/tcl_update_db.git
synced 2024-11-13 00:16:46 +00:00
Added possibly useful views.
This commit is contained in:
parent
58c277661f
commit
c759256adc
@ -19,6 +19,11 @@ CREATE TABLE "devices" (
|
|||||||
"name" TEXT -- e.g. Unlocked USA, Black KEYone
|
"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
|
-- we only care about the first file for now
|
||||||
CREATE TABLE "files" (
|
CREATE TABLE "files" (
|
||||||
"sha1" TEXT UNIQUE PRIMARY KEY, -- checksum of file
|
"sha1" TEXT UNIQUE PRIMARY KEY, -- checksum of file
|
||||||
@ -50,3 +55,7 @@ CREATE UNIQUE INDEX "index_updates" ON "updates" (
|
|||||||
"fwId",
|
"fwId",
|
||||||
"file_id"
|
"file_id"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE VIEW "updates_files" AS
|
||||||
|
SELECT * FROM "updates" u
|
||||||
|
LEFT JOIN "files" f ON u.file_sha1=f.sha1;
|
||||||
|
Loading…
Reference in New Issue
Block a user