Commit 046cfe99 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaLibrary: Handle application downgrade

We might end up with an application that has seen a more recent DB
model. Handle that "gracefully" by recreating the database
parent 0d9ace49
......@@ -734,7 +734,9 @@ bool MediaLibrary::updateDatabaseModel( unsigned int previousVersion )
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 )
// In case of downgrade, just recreate the database
if ( previousVersion < 3 ||
previousVersion > Settings::DbModelVersion )
{
if( recreateDatabase() == false )
return false;
......
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