Commit 175cd2e9 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Settings: Bump DB model version

parent da446b55
......@@ -650,7 +650,10 @@ void MediaLibrary::addLocalFsFactory()
bool MediaLibrary::updateDatabaseModel( unsigned int previousVersion )
{
if ( previousVersion == 1 )
LOG_INFO( "Updating database model from ", previousVersion, " to ", Settings::DbModelVersion );
// Up until model 3, it's safer (and potentially more efficient with index changes) to drop the DB
// It's also way simpler to implement
if ( previousVersion <= 3 )
{
// Way too much differences, introduction of devices, and almost unused in the wild, just drop everything
std::string req = "PRAGMA writable_schema = 1;"
......@@ -660,7 +663,7 @@ bool MediaLibrary::updateDatabaseModel( unsigned int previousVersion )
return false;
if ( createAllTables() == false )
return false;
++previousVersion;
previousVersion = 3;
}
// To be continued in the future!
......
......@@ -32,7 +32,7 @@
namespace medialibrary
{
const uint32_t Settings::DbModelVersion = 2u;
const uint32_t Settings::DbModelVersion = 3u;
Settings::Settings()
: m_dbConn( nullptr )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment