Various fixes + refacto

This commit is contained in:
emeric
2020-07-05 15:15:51 +02:00
parent c67e54aead
commit 50b0fd1cb8
21 changed files with 390 additions and 196 deletions
+7 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Emeric Poupon
auth_mode(C) 2013 Emeric Poupon
*
* This file is part of LMS.
*
@@ -40,7 +40,7 @@
namespace Database {
#define LMS_DATABASE_VERSION 24
#define LMS_DATABASE_VERSION 25
using Version = std::size_t;
@@ -267,6 +267,11 @@ CREATE TABLE "user_backup" (
// Just increment the scan version of the settings to make the next scheduled scan rescan everything
ScanSettings::get(*this).modify()->incScanVersion();
}
else if (version == 24)
{
// User's AuthMode
_session.execute("ALTER TABLE user ADD auth_mode INTEGER NOT NULL DEFAULT(" + std::to_string(static_cast<int>(User::defaultAuthMode)) + ")");
}
else
{
LMS_LOG(DB, ERROR) << "Database version " << version << " cannot be handled using migration";