Fix: Create correct sql schema

This commit is contained in:
Martin Brodbeck 2018-10-08 14:30:42 +02:00
parent cdeea37f8c
commit cdec552f04

View file

@ -72,7 +72,7 @@ void Database::createNew()
std::string sqlCreateKima2{"CREATE TABLE IF NOT EXISTS kima2 ("
"version INTEGER NOT NULL);"
"INSERT INTO kima2 (version) VALUES (1);"};
"INSERT INTO kima2 (version) VALUES (2);"};
sqlStrings.push_back(sqlCreateKima2);
std::string sqlCreateSellers{"CREATE TABLE IF NOT EXISTS sellers ("
"id TEXT PRIMARY KEY NOT NULL, "
@ -111,6 +111,11 @@ void Database::createNew()
");"};
sqlStrings.push_back(sqlCreateSalesItems);
std::string sqlInitialEntries{"INSERT OR IGNORE INTO sellers (id, seller_no, first_name, last_name, "
"num_offered_articles) VALUES "
"('11111111-1111-1111-1111-111111111111', 0, 'Sonderkonto', 'Sonderkonto', 0)"};
sqlStrings.push_back(sqlInitialEntries);
beginTransaction();
for (const auto& sql : sqlStrings) {
exec(sql);