append versions to db backups

This commit is contained in:
Martin Rotter 2023-06-06 07:47:49 +02:00
parent f925bf3a77
commit fd86810fce
3 changed files with 9 additions and 1 deletions

View File

@ -220,3 +220,9 @@ MessageCategory::MessageCategory(const MessageCategory& other) {
QString MessageCategory::title() const {
return m_title;
}
MessageCategory& MessageCategory::operator=(const MessageCategory& other) {
m_title = other.m_title;
return *this;
}

View File

@ -43,6 +43,8 @@ class RSSGUARD_DLLSPEC MessageCategory : public QObject {
QString title() const;
MessageCategory& operator=(const MessageCategory& other);
private:
QString m_title;
};

View File

@ -249,7 +249,7 @@ QSqlDatabase SqliteDriver::initializeDatabase(const QString& connection_name, bo
if (installed_db_schema < QSL(APP_DB_SCHEMA_VERSION).toInt()) {
// Now, it would be good to create backup of SQLite DB file.
if (IOFactory::copyFile(databaseFilePath(), databaseFilePath() + ".bak")) {
if (IOFactory::copyFile(databaseFilePath(), databaseFilePath() + QSL("-v%1.bak").arg(installed_db_schema))) {
qDebugNN << LOGSEC_DB << "Creating backup of SQLite DB file.";
}
else {