From adb5adea57d84caf7adb08d678ec3c07071da9ab Mon Sep 17 00:00:00 2001 From: Rish Date: Tue, 23 Jun 2020 22:13:32 +0530 Subject: [PATCH] Fixed incorrect brand structure in settings migration no issue - Previous migration in commit - https://github.com/TryGhost/Ghost/commit/2614565d5abf1982b61c7ef6e9360f2b9ddb0574 - was using incorrect json structure for brand -> primary_color - Fixes the up/down migrations to work on correct existing `brand: primary_color` structure --- .../migrations/versions/3.22/02-settings-key-renames.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/server/data/migrations/versions/3.22/02-settings-key-renames.js b/core/server/data/migrations/versions/3.22/02-settings-key-renames.js index a25ba7adc7..abcf0478a5 100644 --- a/core/server/data/migrations/versions/3.22/02-settings-key-renames.js +++ b/core/server/data/migrations/versions/3.22/02-settings-key-renames.js @@ -37,7 +37,7 @@ module.exports = { .select('value'); const value = JSON.parse(brandResult[0].value); - const accentColor = value.brand.primaryColor || ''; + const accentColor = value.primaryColor || ''; logging.info(`Updating brand.primaryColor in settings to accent_color with value '${accentColor}'`); @@ -74,9 +74,7 @@ module.exports = { .where('key', 'accent_color') .update('key', 'brand') .update('value', JSON.stringify({ - brand: { - primaryColor - } + primaryColor })); } };