Update upgrade.php (#906)

fix upgrade.php - admin.totp_secret field was not being added in the right place which caused an error. 

see also #899, thanks @jimlucas
This commit is contained in:
James Lucas III authored and GitHub committed 2025-02-23 20:21:27 +00:00
1 parent 9620056277
commit dce68cdf50
1 file changed
+3 -3
+3 -3
View File
@@ -2270,7 +2270,7 @@ function upgrade_1848_sqlite()
function upgrade_1849_mysql()
{
_db_add_field('mailbox', 'totp_secret', "VARCHAR(255) {UTF-8} DEFAULT NULL", 'password_expiry');
_db_add_field('admin', 'totp_secret', "VARCHAR(255) {UTF-8} DEFAULT NULL", 'vacation_notification');
_db_add_field('admin', 'totp_secret', "VARCHAR(255) {UTF-8} DEFAULT NULL", 'token_validity');
$totp_exception_table = table_by_key('totp_exception_address');
db_query_parsed("
@@ -2300,7 +2300,7 @@ function upgrade_1849_mysql()
function upgrade_1849_pgsql()
{
_db_add_field('mailbox', 'totp_secret', "VARCHAR(255) {UTF-8} DEFAULT NULL", 'password_expiry');
_db_add_field('admin', 'totp_secret', "VARCHAR(255) {UTF-8} DEFAULT NULL", 'vacation_notification');
_db_add_field('admin', 'totp_secret', "VARCHAR(255) {UTF-8} DEFAULT NULL", 'token_validity');
if (!_pgsql_object_exists('totp_exception_address')) {
db_query_parsed("
@@ -2330,7 +2330,7 @@ function upgrade_1849_pgsql()
function upgrade_1849_sqlite()
{
_db_add_field('mailbox', 'totp_secret', "VARCHAR(255) {UTF-8} DEFAULT NULL", 'password_expiry');
_db_add_field('admin', 'totp_secret', "VARCHAR(255) {UTF-8} DEFAULT NULL", 'vacation_notification');
_db_add_field('admin', 'totp_secret', "VARCHAR(255) {UTF-8} DEFAULT NULL", 'token_validity');
db_query_parsed("
CREATE TABLE {IF_NOT_EXISTS} totp_exception_address (
id {AUTOINCREMENT},