From 4c01abf440d24c00e237e6e9eca3dfe4a5693183 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 26 May 2025 15:51:48 +0100 Subject: [PATCH] try and ensure core db tables are InnoDB format for MySQL users upgrading. --- public/upgrade.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public/upgrade.php b/public/upgrade.php index 781d4b42..585a1117 100644 --- a/public/upgrade.php +++ b/public/upgrade.php @@ -2140,12 +2140,25 @@ function upgrade_1847() // no op, function exists in the postfixadmin_3.3 branch doing some collation fixes. } +function move_core_tables_to_innodb() +{ + $tables = ['admin', 'alias_domain', 'alias', 'config', 'domain_admins', 'domain', 'fetchmail', 'log', 'mailbox', 'quota', 'quota2']; + + foreach ($tables as $table) { + $table_to_modify = table_by_key($table); + db_query("ALTER TABLE $table_to_modify Engine=InnoDB"); + } +} + /** * Add DKIM tables * @return void */ function upgrade_1848_mysql() { + + move_core_tables_to_innodb(); + $dkim_key_table = table_by_key('dkim'); $dkim_signing_table = table_by_key('dkim_signing'); $domain_table = table_by_key('domain');