Update configuration DB
This prevents a lockout scenario where the root user may be left without permissions if the DB was created prior to this PR.
This commit is contained in:
		
							parent
							
								
									a2c769f173
								
							
						
					
					
						commit
						bbd55263df
					
				@ -18,7 +18,7 @@
 | 
			
		||||
#ifndef BAN_MANAGER_H
 | 
			
		||||
#define BAN_MANAGER_H
 | 
			
		||||
 | 
			
		||||
#define DB_VERSION 1
 | 
			
		||||
#define DB_VERSION 2
 | 
			
		||||
 | 
			
		||||
#include <QDateTime>
 | 
			
		||||
#include <QFileInfo>
 | 
			
		||||
 | 
			
		||||
@ -399,6 +399,10 @@ void DBManager::updateDB(int current_version)
 | 
			
		||||
        QSqlQuery("ALTER TABLE bans ADD COLUMN MODERATOR TEXT");
 | 
			
		||||
        Q_FALLTHROUGH();
 | 
			
		||||
    case 1:
 | 
			
		||||
        QSqlQuery("PRAGMA user_version = " + QString::number(1));
 | 
			
		||||
        Q_FALLTHROUGH();
 | 
			
		||||
    case 2:
 | 
			
		||||
        QSqlQuery("UPDATE users SET ACL = 'SUPER' WHERE USERNAME = 'root'");
 | 
			
		||||
        QSqlQuery("PRAGMA user_version = " + QString::number(DB_VERSION));
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user