0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

try and fix db schema for app password stuff for Sqlite

This commit is contained in:
David Goodwin 2023-12-27 16:10:12 +00:00
parent dc792a0222
commit 0829e032d4

View File

@ -2324,3 +2324,28 @@ 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_query_parsed("
CREATE TABLE {IF_NOT_EXISTS} totp_exception_address (
id {AUTOINCREMENT},
ip varchar(46) NOT NULL,
username varchar(255) DEFAULT NULL,
description varchar(255) DEFAULT NULL
);
");
db_query_parsed("
CREATE UNIQUE INDEX ip_user ON totp_exception_address (ip,username)
");
db_query_parsed("
CREATE TABLE {IF_NOT_EXISTS} mailbox_app_password(
id {AUTOINCREMENT},
username varchar(255) DEFAULT NULL,
description varchar(255) DEFAULT NULL,
password_hash varchar(255) DEFAULT NULL
)
");
}