mirror of
https://github.com/YACReader/yacreader
synced 2025-05-25 18:00:46 -04:00
Add DB_VERSION to keep track of DBs versions
This will make easy to track compatibility with a certain DB structure across different flavors of YACReader. It will only change when the DB structure changes.
This commit is contained in:
parent
c0effb43b3
commit
71a7a07274
@ -1420,7 +1420,7 @@ void LibraryWindow::loadLibrary(const QString &name)
|
||||
QString dbVersion;
|
||||
if (d.exists(path) && d.exists(path + "/library.ydb") && (dbVersion = DataBaseManagement::checkValidDB(path + "/library.ydb")) != "") // si existe en disco la biblioteca seleccionada, y es válida..
|
||||
{
|
||||
int comparation = DataBaseManagement::compareVersions(dbVersion, VERSION);
|
||||
int comparation = DataBaseManagement::compareVersions(dbVersion, DB_VERSION);
|
||||
|
||||
if (comparation < 0) {
|
||||
int ret = QMessageBox::question(this, tr("Update needed"), tr("This library was created with a previous version of YACReaderLibrary. It needs to be updated. Update now?"), QMessageBox::Yes, QMessageBox::No);
|
||||
|
@ -20,7 +20,7 @@ void LibrariesUpdater::updateIfNeeded()
|
||||
|
||||
QString dbVersion;
|
||||
if (d.exists(path) && d.exists(path + "/library.ydb") && (dbVersion = DataBaseManagement::checkValidDB(path + "/library.ydb")) != "") {
|
||||
int comparation = DataBaseManagement::compareVersions(dbVersion, VERSION);
|
||||
int comparation = DataBaseManagement::compareVersions(dbVersion, DB_VERSION);
|
||||
|
||||
if (comparation < 0) {
|
||||
bool updated = DataBaseManagement::updateToCurrentVersion(path);
|
||||
|
@ -8,6 +8,10 @@
|
||||
|
||||
#define VERSION "9.13.1"
|
||||
|
||||
// Used to check if the database needs to be updated, the version is stored in the database.
|
||||
// This value is only incremented when the database structure changes.
|
||||
#define DB_VERSION "9.13.1"
|
||||
|
||||
#define IMPORT_COMIC_INFO_XML_METADATA "IMPORT_COMIC_INFO_XML_METADATA"
|
||||
#define COMPARE_MODIFIED_DATE_ON_LIBRARY_UPDATES "COMPARE_MODIFIED_DATE_ON_LIBRARY_UPDATES"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user