From c4083967dfd1863473b4f39fd0b5a21f7e4b99ad Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 14 Jan 2022 13:27:32 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A1=20Added=20database=20upgrade=20war?= =?UTF-8?q?ning=20for=20required=20MySQL=208=20in=20Ghost=205.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - Ghost 5.0 will require MySQL 8 when running in production so we've added a warning to the whats new/about screen to give some visibility for self-hosters to prepare - updated `whatsnew` controller to native class syntax --- ghost/admin/app/controllers/whatsnew.js | 31 ++++++++++++++++--------- ghost/admin/app/templates/whatsnew.hbs | 11 +++++++++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/ghost/admin/app/controllers/whatsnew.js b/ghost/admin/app/controllers/whatsnew.js index acc6b0c8f5..11c94a1576 100644 --- a/ghost/admin/app/controllers/whatsnew.js +++ b/ghost/admin/app/controllers/whatsnew.js @@ -1,17 +1,26 @@ import Controller from '@ember/controller'; -import {computed} from '@ember/object'; import {inject as service} from '@ember/service'; -/* eslint-disable ghost/ember/alias-model-in-controller */ -export default Controller.extend({ - config: service(), - upgradeStatus: service(), - whatsNew: service(), +export default class WhatsNewController extends Controller { + @service config; + @service upgradeStatus; + @service whatsNew; - queryParams: ['entry'], + queryParams = ['entry']; - copyrightYear: computed(function () { - let date = new Date(); + get copyrightYear() { + const date = new Date(); return date.getFullYear(); - }) -}); + } + + get showDatabaseWarning() { + const isProduction = !!this.config.get('environment').match?.(/production/i); + const isPro = !!this.config.get('hostSettings')?.siteId; + + if (isProduction && !isPro) { + return true; + } + + return false; + } +} diff --git a/ghost/admin/app/templates/whatsnew.hbs b/ghost/admin/app/templates/whatsnew.hbs index 9c5fd3a1b7..7494d38b3f 100644 --- a/ghost/admin/app/templates/whatsnew.hbs +++ b/ghost/admin/app/templates/whatsnew.hbs @@ -40,6 +40,7 @@ + {{#if this.upgradeStatus.message}}

@@ -47,6 +48,7 @@

{{/if}} + + + {{#if this.showDatabaseWarning}} +
+

+ Warning: MySQL 8 will be the required database in the next major release of Ghost. Make sure your database is up to date to ensure forwards compatibility. +

+
+ {{/if}} +