diff --git a/mod/admin.php b/mod/admin.php index 544328500..c5ad7de3b 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -428,6 +428,14 @@ function admin_page_queue(&$a) { * @return string */ function admin_page_summary(&$a) { + // are there MyISAM tables in the DB? If so, trigger a warning message + $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine`='myisam' LIMIT 1"); + $showwarning = false; + $warningtext = ""; + if (dbm::is_result($r)) { + $showwarning = true; + $warningtext = sprintf(t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See here for a guide that may be helpful converting the table engines. You may also use the convert_innodb.sql in the /util directory of your Friendica installation.
'), 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html'); + } $r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`"); $accounts = array( array(t('Normal Account'), 0), @@ -478,7 +486,9 @@ function admin_page_summary(&$a) { '$platform' => FRIENDICA_PLATFORM, '$codename' => FRIENDICA_CODENAME, '$build' => get_config('system','build'), - '$plugins' => array(t('Active plugins'), $a->plugins) + '$plugins' => array(t('Active plugins'), $a->plugins), + '$showwarning' => $showwarning, + '$warningtext' => $warningtext )); } diff --git a/util/convert_innodb.sql b/util/convert_innodb.sql new file mode 100644 index 000000000..6b065f3b2 --- /dev/null +++ b/util/convert_innodb.sql @@ -0,0 +1,4 @@ + +SELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' engine=InnoDB;') +FROM information_schema.tables +WHERE engine = 'MyISAM'; diff --git a/view/global.css b/view/global.css index e3cbf08c3..85e45db00 100644 --- a/view/global.css +++ b/view/global.css @@ -473,3 +473,11 @@ td.pendingnote { td.pendingnote > p > span { font-weight: bold; } + +/* warning message */ +.warning-message { + padding: 10px; + margin: 5px; + border-left: 5px solid #f00; + font-weight: bold; +} diff --git a/view/templates/admin_summary.tpl b/view/templates/admin_summary.tpl index 08e84b008..34df0db51 100644 --- a/view/templates/admin_summary.tpl +++ b/view/templates/admin_summary.tpl @@ -1,6 +1,11 @@

{{$title}} - {{$page}}

+{{if $showwarning}} +
+

{{$warningtext}}

+
+{{/if}}
{{$queues.label}}