summaryrefslogtreecommitdiffstats
path: root/pica-client/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pica-client/main.cpp')
-rw-r--r--pica-client/main.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/pica-client/main.cpp b/pica-client/main.cpp
index 7df81ce..fcfa3c1 100644
--- a/pica-client/main.cpp
+++ b/pica-client/main.cpp
@@ -135,7 +135,17 @@ static bool create_database()
if (query.lastError().isValid())
goto showerror;
- query.exec("insert into schema_version values (2, strftime('%s','now'));"); //current schema version. update when needed
+ query.exec("create table settings \
+ ( \
+ name varchar(255) not null, \
+ value varchar(255) not null \
+ );"
+ );
+
+ if (query.lastError().isValid())
+ goto showerror;
+
+ query.exec("insert into schema_version values (3, strftime('%s','now'));"); //current schema version. update when needed
if (query.lastError().isValid())
showerror:
@@ -363,6 +373,21 @@ static bool update_database()
schema_ver = 2;
}
+ if (schema_ver == 2)
+ {
+ query.exec("create table settings \
+ ( \
+ name varchar(255) not null, \
+ value varchar(255) not null \
+ );"
+ );
+
+ if (query.lastError().isValid())
+ goto showerror;
+
+ schema_ver = 3;
+ }
+
if (query.lastError().isValid())
showerror:
{