From 570ace7307556580c6ce9b54df12de76f1c52f99 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Wed, 1 Nov 2017 18:55:32 +0100 Subject: [PATCH] Use one table for all update files. Added mapping table. --- sql/dbschema.sql | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sql/dbschema.sql b/sql/dbschema.sql index 259826b..a3e6314 100644 --- a/sql/dbschema.sql +++ b/sql/dbschema.sql @@ -37,9 +37,16 @@ INSERT INTO "devices" VALUES ("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 +CREATE TABLE "updates" ( + "updateId" INTEGER PRIMARY KEY AUTOINCREMENT, + "fv" TEXT, -- version, e.g. AAQ302 + "sha1" TEXT, -- SHA1 checksum of file + "type" TEXT, -- FULL or OTA + "note" TEXT, -- some note for this file (optional) ); +-- Maps update files to devices +CREATE TABLE "update_map" ( + "deviceId" INTEGER REFERENCES "devices" ("deviceId"), + "updateId" INTEGER REFERENCES "updates" ("updateId") +);