From 29092e992b2631345b9fcef2bd02eec3d2bf18ce Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 24 May 2017 20:22:18 +0200 Subject: Fail early for incorrectly configured instances --- CHANGELOG.md | 6 ++++++ appinfo/info.xml | 2 +- appinfo/install.php | 18 ++++++++++++++++++ appinfo/update.php | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 appinfo/install.php create mode 100644 appinfo/update.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 35641492c..8b73df6a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog All notable changes to this project will be documented in this file. +## 11.0.2 + +### Changed + +- Fail early when an incorrectly configured MySql/MariaDB instance is found to prevent update errors and data loss + ## 11.0.1 ### Fixed diff --git a/appinfo/info.xml b/appinfo/info.xml index 8bf4536e6..fae408c05 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -8,7 +8,7 @@ Before you update to a new version, [check the changelog](https://github.com/nextcloud/news/blob/master/CHANGELOG.md) to avoid surprises. **Important**: To enable feed updates you will need to enable either [Nextcloud system cron](https://docs.nextcloud.com/server/10/admin_manual/configuration_server/background_jobs_configuration.html#cron) or use [an updater](https://github.com/nextcloud/news-updater) which uses the built in update API and disable cron updates. More information can be found [in the README](https://github.com/nextcloud/news).]]> - 11.0.1 + 11.0.2 agpl Bernhard Posselt Alessandro Cosentino diff --git a/appinfo/install.php b/appinfo/install.php new file mode 100644 index 000000000..887821ee7 --- /dev/null +++ b/appinfo/install.php @@ -0,0 +1,18 @@ +getDatabaseConnection()->getParams()['charset']; +$platform = OC::$server->getDatabaseConnection()->getDatabasePlatform(); +if ($platform instanceof MySqlPlatform && $charset !== 'utf8mb4') { + $msg = 'App can not be installed because database MySql/MariaDb uses a ' . + 'non UTF8 charset: ' . $charset .'. Learn more on how to migrate ' . + 'your database to utf8mb4 at ' . + 'https://dba.stackexchange.com/questions/8239/how-to-easily-convert-utf8-tables-to-utf8mb4-in-mysql-5-5'; + throw new Exception($msg); +} \ No newline at end of file diff --git a/appinfo/update.php b/appinfo/update.php new file mode 100644 index 000000000..7f0a9a4c5 --- /dev/null +++ b/appinfo/update.php @@ -0,0 +1,2 @@ +