From d09dc1507a1d3fcbf9f5b66f549d721fc60a6891 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Thu, 2 Nov 2017 00:05:39 +0100 Subject: [PATCH] Fix db schema. --- .gitignore | 1 + sql/dbschema.sql | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7ec1c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/otadb.db3 diff --git a/sql/dbschema.sql b/sql/dbschema.sql index 76a850a..7c81216 100644 --- a/sql/dbschema.sql +++ b/sql/dbschema.sql @@ -19,10 +19,10 @@ CREATE TABLE "models" ( ); -- Needs SQLite 3.7 or newer -INSERT INTO "models" VALUES - (0, "BBB100-1"), - (0, "BBB100-2"), - (1, "BBD100-1") +INSERT INTO "models" ("familyId", "name") VALUES + (1, "BBB100-1"), + (1, "BBB100-2"), + (2, "BBD100-1") ; CREATE TABLE "devices" ( @@ -33,9 +33,9 @@ CREATE TABLE "devices" ( ); -- Needs SQLite 3.7 or newer -INSERT INTO "devices" VALUES - ("PRD-63117-011", 1, "Unlocked EMEA"), - ("PRD-63116-001", 0, "Unlocked USA") +INSERT INTO "devices" ("ref", "modelId", "name") VALUES + ("PRD-63117-011", 2, "Unlocked EMEA"), + ("PRD-63116-001", 1, "Unlocked USA") ; -- we only care about the first file for now @@ -53,7 +53,7 @@ CREATE TABLE "updates" ( "file_size" INTEGER, -- size of first file "file_sha1" TEXT, -- SHA1 checksum of first file "type" TEXT, -- FULL or OTA - "note" TEXT, -- some note for this file (optional) + "note" TEXT -- some note for this file (optional) ); -- Maps update files to devices