code cleanup

This commit is contained in:
Martin Brodbeck 2018-10-09 12:01:58 +02:00
parent 0b4041c13a
commit ad68fb8bf7
1 changed files with 6 additions and 4 deletions

View File

@ -45,7 +45,8 @@ void Database::newDb()
fs::path sourcePath = dbname_; fs::path sourcePath = dbname_;
fs::path destPath = sourcePath.parent_path() / sourcePath.stem(); fs::path destPath = sourcePath.parent_path() / sourcePath.stem();
destPath += std::string("_") += boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()) += ".db"; destPath += std::string("_") +=
boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()) += ".db";
fs::copy_file(sourcePath, destPath, fs::copy_options::overwrite_existing); fs::copy_file(sourcePath, destPath, fs::copy_options::overwrite_existing);
@ -113,9 +114,10 @@ void Database::createNew()
");"}; ");"};
sqlStrings.push_back(sqlCreateSalesItems); sqlStrings.push_back(sqlCreateSalesItems);
std::string sqlInitialEntries{"INSERT OR IGNORE INTO sellers (id, seller_no, first_name, last_name, " std::string sqlInitialEntries{
"num_offered_articles) VALUES " "INSERT OR IGNORE INTO sellers (id, seller_no, first_name, last_name, "
"('11111111-1111-1111-1111-111111111111', 0, 'Sonderkonto', 'Sonderkonto', 0)"}; "num_offered_articles) VALUES "
"('11111111-1111-1111-1111-111111111111', 0, 'Sonderkonto', 'Sonderkonto', 0)"};
sqlStrings.push_back(sqlInitialEntries); sqlStrings.push_back(sqlInitialEntries);
beginTransaction(); beginTransaction();